How can I find tables and fields in a DB at runtime? 
Author Message
 How can I find tables and fields in a DB at runtime?

As our final VB project, my instructor assigned a data manager program
that keeps track of student grades. The assignment is pretty much hard
coded to manage a database with a fixed number of tests and fixed
percentages of the final aver, i.e. test 1-4 cout for 55% and final
exam counts for 45% of final avaerage.

I would like to make the program more flexible, where the user could
create a database from within the program, inputing how many tests he
would like to record, the name of each test, and the percentage of the
final average each named test would count for. Not very elaborate, but
more flexible/useful than the assigned program.

The book we're using is "An Introduction to Programming Using Visual
Basic 6.0" 4th ed - David Schneider. I doesn't go into database
management as far as I need to make the modifications I want for the
final project. Hence,  my questions.

Is there a way to query a newly loaded database for a list of tables
and field names? I want to be able to set recordsource in the program
without hard coding the name of the table into the program. I want the
user to be able to load any grade-type database.

Also, is there a way to store formulas in record fields like on can do
in Excel? If the user can input the percentage that each test counts,
the formula for computing averages can be different for each database.
I really don't want each grade-type database to need a separate file
to determine its manner of computing averages. I guess I could store
the formulas as text and parse them in the program, but I don't know
if thats the right way (efficient way) to go about it .

Finaly, is the DOA object library linked to the program when it is
compiled? If the user is to be able to create a database fron within
the program, it can't reference external objects the user may not
have.

Thanks. I'm pretty new to VB so I hope these questions don't sound too
dumb.



Thu, 10 Oct 2002 03:00:00 GMT  
 How can I find tables and fields in a DB at runtime?
Try TableDefs and Fields
Quote:

> As our final VB project, my instructor assigned a data manager program
> that keeps track of student grades. The assignment is pretty much hard
> coded to manage a database with a fixed number of tests and fixed
> percentages of the final aver, i.e. test 1-4 cout for 55% and final
> exam counts for 45% of final avaerage.

> I would like to make the program more flexible, where the user could
> create a database from within the program, inputing how many tests he
> would like to record, the name of each test, and the percentage of the
> final average each named test would count for. Not very elaborate, but
> more flexible/useful than the assigned program.

> The book we're using is "An Introduction to Programming Using Visual
> Basic 6.0" 4th ed - David Schneider. I doesn't go into database
> management as far as I need to make the modifications I want for the
> final project. Hence,  my questions.

> Is there a way to query a newly loaded database for a list of tables
> and field names? I want to be able to set recordsource in the program
> without hard coding the name of the table into the program. I want the
> user to be able to load any grade-type database.

> Also, is there a way to store formulas in record fields like on can do
> in Excel? If the user can input the percentage that each test counts,
> the formula for computing averages can be different for each database.
> I really don't want each grade-type database to need a separate file
> to determine its manner of computing averages. I guess I could store
> the formulas as text and parse them in the program, but I don't know
> if thats the right way (efficient way) to go about it .

> Finaly, is the DOA object library linked to the program when it is
> compiled? If the user is to be able to create a database fron within
> the program, it can't reference external objects the user may not
> have.

> Thanks. I'm pretty new to VB so I hope these questions don't sound too
> dumb.



Sat, 26 Oct 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. copy runtime a table from db a to db b

2. way to find max var char field lengths of fields in SQL Server table

3. How to copying from one DB table to another DB table

4. Runtime table-creation and field-insertion

5. Finding all tables in a DB

6. Obtaining table names/field names from Access @ runtime

7. Runtime table-creation and field-insertion

8. Recreate tables and fields in backend DB

9. get list of field names in access db table

10. Create new fields in a table based off of fields in another table

11. Create new field in existing table exactly like field in second table

12. updating fields in table from field in another table

 

 
Powered by phpBB® Forum Software