I have an interesting conundrum on my hands...
What I'm trying to do: Through VBA, archive data in ODBC linked tables, into static tables (a one-time snapshot kind of deal).
How:
(1) In my Archive_Master database, looping through the tables, and for each ODBC linked table (T)
(2) Running SQL Make-Table to create Table (T1)
(3) Creating a new database (T1_db) with the same name of the table, (if database doesn't already exist)*
(4) Transferring the newly made static table (T1) to (T1_db)
(5) Deleting (T1) from Archive_Master db.
(6) Loop back to (1)
*reason I need to send the tables to their own databases, is some of them are very large and result in .mdbs over 1 GB
The problem:
This method works well. BUT...
After about 50 or so tables, Archive_Master balloons (obviously) to being above 2 GB, upon which I get the usual errors because the db's size is inflated - this stops the macro.
I'm aware of the challenge compacting the current, open database through VBA (and Compact on close won't work as that will end my macro).
How can I compact this database in code, and allow my code to resume enumerating the tables and archiving them?
tx...a fair maidens hand in marriage and keys to the kingdom in reward
What I'm trying to do: Through VBA, archive data in ODBC linked tables, into static tables (a one-time snapshot kind of deal).
How:
(1) In my Archive_Master database, looping through the tables, and for each ODBC linked table (T)
(2) Running SQL Make-Table to create Table (T1)
(3) Creating a new database (T1_db) with the same name of the table, (if database doesn't already exist)*
(4) Transferring the newly made static table (T1) to (T1_db)
(5) Deleting (T1) from Archive_Master db.
(6) Loop back to (1)
*reason I need to send the tables to their own databases, is some of them are very large and result in .mdbs over 1 GB
The problem:
This method works well. BUT...
After about 50 or so tables, Archive_Master balloons (obviously) to being above 2 GB, upon which I get the usual errors because the db's size is inflated - this stops the macro.
I'm aware of the challenge compacting the current, open database through VBA (and Compact on close won't work as that will end my macro).
How can I compact this database in code, and allow my code to resume enumerating the tables and archiving them?
tx...a fair maidens hand in marriage and keys to the kingdom in reward
Last edited: