Reputation: 252
I have about 10 *.mdb Access files of office version 2003. I am working on client machines on which I have only Excel 2003 installed but not Access.
Each database file has around 50-100 tables in it and each tables has around 20-30 columns. I need to run a VBA script or any import on Excel so that I could copy all the Access tables and its columns into my Excel sheet. I do not require data of Access tables only the table and its column names is what I require.
Upvotes: 0
Views: 1076
Reputation: 38745
The plan:
For Each MDB In YourMdbs (file in folder, hard-coded list, ...)
For Each TABLE In MDB (filtered, no MSys tables, ...)
XLS = FSpec to non-existing .xls corresponding to MDB
Execute on ADO connection to XLS:
SELECT * INTO <TABLE> FROM <TABLE> IN "<FSpec to MDB>" WHERE 1=0
based on: IN CLAUSE
This approach will export the .mdbs table schemata to .xls sheets without any fuss with ADOX schema.
WRT comments:
Upvotes: 2