Lethal_J
asked on
Listing Tables Using ADO or DAO
Hello,
Ive been contracted to write a program to update the data structures and tables of an Access database when the client deploys an updated version of their software. This will run initially and upgrade the database with the latest fields and tables as required.
However, im a little stumped as to how to read the table names from the MDB file. I cannot use constants for the table names in this case as the client will be using this program on several other projects as well.
Is there a way to list the tables of an Access database using either ADO or DAO, or is there perhaps another method which I am overlooking?
Thanks for your help.
Ive been contracted to write a program to update the data structures and tables of an Access database when the client deploys an updated version of their software. This will run initially and upgrade the database with the latest fields and tables as required.
However, im a little stumped as to how to read the table names from the MDB file. I cannot use constants for the table names in this case as the client will be using this program on several other projects as well.
Is there a way to list the tables of an Access database using either ADO or DAO, or is there perhaps another method which I am overlooking?
Thanks for your help.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Public Sub listtablenames()
Dim RS As New ADODB.Recordset
RS.Open "Select * from msysobjects", CN
Do Until RS.EOF
Debug.Print RS("Name")
RS.MoveNext
Loop
RS.Close
End Sub