Link to home
Start Free TrialLog in
Avatar of jpsFW
jpsFW

asked on

open database2 from vb code in database1 - db2 will then compact db 1

I have an importing database scheduled to run early morning.  I need to compact this database after importing.  I can compact the db using another database but struggling to code the compacting database to open after importing is complete then close the importing database
Avatar of 1William
1William

Try this:
After the importing is done, set a boolean field in a table that is linked to the scond database, then close the first database.  In an on timer event in the second database, check the value of the boolean.  Once it changes, Pause for a few seconds (time for the first database to close) then run your maintenance routine.  after the routine is done, reset the boolean.
ASKER CERTIFIED SOLUTION
Avatar of shanesuebsahakarn
shanesuebsahakarn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jpsFW

ASKER

I split out the importing side of the database and set this database to run on scheduler - i didn't realise there was a compact on close option so have set that to yes as the only time the database opens is to import.