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

How to find how many table in database 1

Status
Not open for further replies.

SRawat

Programmer
Aug 12, 2002
6
0
0
IN
In DAO we useing tabledef to find out all tables in database (Access)

but i am not able to find form ADO so how to find

 
------------------------------------------------------------
'Make a reference to
'Microsoft ActiveX Data Objects 2.5 Library (msado15.dll) and
'Microsoft ADO Ext. 2.5 for dll and security (MSADOX.DLL)
Private Sub Form_Load()
Dim StrCon As String
Dim Cat As ADOX.Catalog

'Connection string, remember to change the name of the database.
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
MsgBox CStr(Cat.Tables.Count) & " tables in database."
Set Cat = Nothing
End Sub
----------------------------------------------------------- Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top