Using access 2000, ado and jet
How can i add the table names from an access db to a combobox ?
Printable View
Using access 2000, ado and jet
How can i add the table names from an access db to a combobox ?
Use the Connection.OpenSchema method to return a variety of database schema information.
To get a list of tables the code would be
Code:Dim db As ADODB.Connection
Dim rs As ADODB.Recordset
Set db = New ADODB.Connection
db.Open "provider=microsoft.jet.oledb.4.0;data source=c:\projects\northwind.mdb"
Set rs = db.OpenSchema(adSchemaTables, Array(Empty, Empty, Empty, "Table"))
Do Until rs.EOF
Combo1.AddItem rs.Fields("Table_Name").Value
rs.MoveNext
Loop
rs.Close
db.Close
thanks brucevde
works perfect