Import all tables from one database to another

D

Debbie

Hello,
I need to programatically import all the tables from one Access database to
another Access database. I know how to use the Transfer Database command but
I do not know how to loop through all the tables in the dataabase that I want
to import from. Can anyone give me an example of how to do that part of it?
Thanks very much.
Debbie
 
K

Ken Snell \(MVP\)

General code to loop through tables:

Dim dbs As DAO.Database
Dim tdf As DAO.TableDef
Set dbs = CurrentDb
For Each tdf in dbs.TableDefs
' code here to look at tdf object's properties, etc.
Next tdf
dbs.Close
Set dbs = Nothing
 
D

Debbie

Ken,
Thank you so much. Just out of curiosity, can this be done in ADO? Thanks
again,
Debbie
 
D

Debbie

Ken,
Thank you SO MUCH! You were a great help. I will try it out. Take care,
Debbie
 
Top