Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List tables and columns of Access database

Status
Not open for further replies.

graabein

Programmer
Oct 9, 2002
186
NO
Hi,

A quick question from me. How do I list all the tablenames of an Access database from Visual Basic? I tried different SQL queries to no avail. I also need to list column names and data type after I've selected a table.

Firstly I want to populate a combo box with table names. Then I want to list column names and their data type after I've selected a table from the combo box.

What do the two SQL queries look like?

[cow]
graabein
 
Access has the table names in a MSysObjects table (view it by clicking "System" in the View options). There is a type field you can filter on to show just tables.

Fields are not in a system table - you have to read through the Fields collection of a TableDef object via VBA. Look in the Access forums for examples of getting metadata from an Access database.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top