Surely someone can help me with this...
I know I can use the alltables collection to get the table names, but I also need to get the tables' field names as well. X-)
Guess what I did yesterday!
As you are a technical sort of chap I'll just paste my stuff in. It's not hard anyway.
Here we go
This finds the table names
Set rs = cnnnew.OpenSchema(adSchemaTables)
If Not (rs.EOF And rs.BOF) Then
Do Until rs.EOF
If UCase$(rs(3)) = "TABLE" Then
lstTables.AddItem rs(2)
End If
rs.MoveNext
Loop
End If
This finds the columns for table addresses
Set rs = cnnBasic.OpenSchema(adSchemaColumns)
If Not (rs.EOF And rs.BOF) Then
Do Until rs.EOF
If UCase$(rs(2)) = "ADDRESSES" Then
TListDestination.AddItem rs(3)
TListDestination.Indent(TListDestination.ListCount - 1) = 0
End If
rs.MoveNext
Loop
End If
I can't get it work that well for Excel tho. It seems to lump columns and sheets in together.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.