Click to See Complete Forum and Search --> : Table Names


Leo Koach
December 10th, 1999, 04:03 PM
I used to use a little code to get the table names for my programs like this...
Private Function GetTbl()
Dim TblNM As String
Dim mytest As String

Set db = OpenDatabase(dbOPEN)
For Each tbl In db.TableDefs

TblNM = tbl.Name
mytest = Left$(TblNM, 3)
If mytest <> "MSy" Then
List1.AddItem TblNM ' + fld.Name
Debug.Print TblNM ', fld.Name
End If
Next

End Function

Now I am learning ADO and I don't know how to get the table names.

Please help.

Thank you
Leo Koach
leok@mindpulse.com

Gianandrea
December 10th, 1999, 04:54 PM
Hello,
you do not have a collection like before but you can use a 'schema', wich is much like a recordset containing all the infos you need.

set conntemp=server.createobject("adodb.connection")
conntemp.open parmDSN

on error resume next
set rsSchema=conntemp.OpenSchema(???)



The ??? value ranges from 1 to 30, the one you are looking for is 21 but try out the others!
bye
Gianandrea
http://www2.lario.com/dna