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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding the names of tables

Status
Not open for further replies.

GusBrown

Programmer
Nov 24, 2000
38
GB
Hi,

Assume that you have a .mdb file and that you know its name so you can set up a connection to it (I'm using VBScript/ASP).

Does anyone know how I can find the names of the tables in that file? Cunning SQL statements? Is there some sort of meta table which holds this data?

Thanks,

Gus
 
From the VBA Help in Access (Alt F11 then F1) with a search topic "table names":

Dim dbsNorthwind As Database
Dim tdfLoop As TableDef
Dim prpLoop As Property

Set dbsNorthwind = OpenDatabase("Northwind.mdb")

With dbsNorthwind
Debug.Print .TableDefs.Count & _
" TableDefs in " & .Name

' Enumerate TableDefs collection.
For Each tdfLoop In .TableDefs
Debug.Print " " & tdfLoop.Name
Next tdfLoop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top