P
pteranodon
For testing purposes, I sometime create a snapshot version of my SQL
server tables in a MDB file. This lets me work away from the server
with the data as it stands at the time of MDB creation. I currently
achieve this with:
- creating an .ADP project connected to the SQL server database
- create an empty .MDB file
- open the .MDB and File->Get External Data->Import...
- point to the .ADP
- Select all tables
- OK
This leaves me with an MDB with stand-alone versions of the SQL
server's tables (minus their indexes) that I can query and play around
with.
How could I go through these steps in code? I see that I could use
DoCmd.TransferDatabase, but I would need to repeat it for each table
in the database and I don't know how to get a list of tables from an
ADP or a SQL server database.
For bonus points, how do I import (or recreate) the indexes that exist
on the source tables?
Thanks for any pointers!
Kevin
server tables in a MDB file. This lets me work away from the server
with the data as it stands at the time of MDB creation. I currently
achieve this with:
- creating an .ADP project connected to the SQL server database
- create an empty .MDB file
- open the .MDB and File->Get External Data->Import...
- point to the .ADP
- Select all tables
- OK
This leaves me with an MDB with stand-alone versions of the SQL
server's tables (minus their indexes) that I can query and play around
with.
How could I go through these steps in code? I see that I could use
DoCmd.TransferDatabase, but I would need to repeat it for each table
in the database and I don't know how to get a list of tables from an
ADP or a SQL server database.
For bonus points, how do I import (or recreate) the indexes that exist
on the source tables?
Thanks for any pointers!
Kevin