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

Detect tables in a access file

Status
Not open for further replies.

Gti

Programmer
Jul 23, 2001
99
PT
I need to know what tables are in a access file, given only the name of the file

How can i do it?

Tkx

;-)
 
Set rs = cnnnew.OpenSchema(adSchemaTables)
If Not (rs.EOF And rs.BOF) Then
Do Until rs.EOF
If UCase$(rs(3)) = "TABLE" Then
lstTables.AddItem rs(2)
End If
rs.MoveNext
Loop
End If Peter Meachem
peter@accuflight.com
 
-----------------------------------------------------------
StrCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = c:\tmp\test.mdb"
'Set the catalogs connection
Set Cat = New ADOX.Catalog
Cat.ActiveConnection = StrCon
For i = 0 To Cat.Tables.Count - 1
if left$(Cat.tables(i),4)<>&quot;MSys&quot; then
....
end if
Next i
-----------------------------------------------------------

Sunaj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top