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

Posted on 2003-03-24
Medium Priority
Last Modified: 2008-02-20
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
Question by:jpsFW
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 18

Expert Comment

ID: 8194859
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.
LVL 41

Accepted Solution

shanesuebsahakarn earned 300 total points
ID: 8194960
Use Task Scheduler if you have it to launch and execute your compacting database at a later time (say a few hours later) - is that an option ?

Alternatively, are you importing into linked tables ? If so, you can simply compact the database where the tables reside from the front-end database.

Author Comment

ID: 8202470
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.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question