
02-05-2002, 06:09 PM
|
 |
Green-Eyed
Super Moderator * Guru *
|
|
Join Date: May 2001
Location: Bangkok, Thailand
Posts: 10,261
|
|
|
Do you mean:
you have an Access db and you plan to archive data from it, to a separate Access db.
You want to create a routine which will find the archive .mdb, then export records to the corresponding table if that table exists already..
Correct?
If so, it's not so complicated.
Store the archive .mdb filename in a table and use the Dir() function to verify its existence before running the rest of the routine.
Use your Tools/Options menu and tick the 'Hidden Objects' on the 'View' tab.
Run a query using this SQL:
"SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Flags)=0) AND ((MSysObjects.Type)=1))"
Open your archive .mdb and run the same query to compare the tables and add any which are missing (lookup TableDef collection).
Run a separate routine which runs append queries to the archive db for every table in the source .mdb.
GL!
|
|