I worked it out.
Here is the code I used. It lists all tables that have "IN" at the start of their name.
Dim Cnxn As ADODB.Connection
Dim rstSchema As ADODB.Recordset
Dim strCnxn As String
Set Cnxn = New ADODB.Connection
strCnxn = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\products.mdb"
Cnxn.Open strCnxn
Set rstSchema = Cnxn.OpenSchema(adSchemaTables)
Do Until rstSchema.EOF
If Mid(rstSchema!TABLE_NAME, 1, 2) = "IN" Then
List1.AddItem Mid(rstSchema!TABLE_NAME, 3)
End If
rstSchema.MoveNext
Loop
' clean up
rstSchema.Close
Cnxn.Close
Set rstSchema = Nothing
Set Cnxn = Nothing
Enter your message below
Sign in or Join us (it's free).