Compacting via button

K

kabaka

Hi - here's my problem:

I have a front/back end database application. When the user (and there will
only ever be one) opens the f/e the code in the 'On Open' from my welcome
form checks the data stored a b/e table versus the linked OBDC tables on the
system. If the dates are different then the b/e is updated. That works
fine. However, my database is huge (600 mbs after compacting - due to
several large tables) and consequently requires compacting after each update.
I would like to be able to do this through my button also. But, because I
have opened my b/e through code, even after it is closed the ldb file remains
preventing any compacting to the b/e.

The only way to remove the ldb file (or so it seems) is to close my f/e
which of course defeats the purpose.

Any help? Thanks!
 
L

Larry Daugherty

Hi,

You could create a table with one record to hold the date of the last update
or as easily create a text file with a single line with the date. In the
Open event of your first form to open you could check the date and, if
necessary, put up a dialog box informing you that it is updating and telling
you to start the application again a short time after it quits.

Alternatively, you could create a separate small application to do nothing
but kick off the update and quit with a compact by using the system
agent/scheduler

HTH
 
Top