FE/BE and Compact-Repair?

M

MK

I have been struggling with something that I am sure is simple (Forest for
the trees effect).
I have a traditional FE/BE Database where the BE is password protected,
Tables are linked. I have the option set to compact/repair when any database
is closed. Problem is the BE is never opened, so it never gets closed
(compacted/repaired). I would like to set up a proceedure that does
something along the lines of when the FE is closed the BE is compacted and
repaired.
Any suggestions would be appreciated (even if it sounds too simple)....
Thanks .... MartyK
 
R

Rick Brandt

MK said:
I have been struggling with something that I am sure is simple
(Forest for the trees effect).
I have a traditional FE/BE Database where the BE is password
protected, Tables are linked. I have the option set to compact/repair
when any database is closed. Problem is the BE is never opened, so it
never gets closed (compacted/repaired). I would like to set up a
proceedure that does something along the lines of when the FE is
closed the BE is compacted and repaired.
Any suggestions would be appreciated (even if it sounds too
simple).... Thanks .... MartyK

As long as your front end is not currently "using" any of the objects in the
back end then it can be compacted in code using...

DBEngine.CompactDatabase "Path to File", "Path to Destination"

You cannot use this method to compact the file "into itself" like you can
from the GUI, but you can compact to a new file name, delete the original
file, and then rename the compacted one.

However; a split application normally means multiple users so you can only
do the above when not only you are not using the back end file, but also
when nobody else is either, so having it run every time you close the front
end will not work very well.
 
Top