Access compact and repair code

  • Thread starter Thread starter George Moore
  • Start date Start date
G

George Moore

Does anyone have code for the compact and repair process
that I can put in my application?
 
I am not sure if this will answer you problem or not, but it is the answer I
came up with for the same problem in my databases.
Under Tools - Options, there is an option to "Compact on close." If you
check this box, the database will be compacted when it is closed. This
seems to work in a shared environment as well. The catch is that you have
to have the right version of Access for the option to appear.

Lori
 
Jeff Clark said:
doesn't work, says the application needs to be closed first
sigh

If you are trying to compact a backend from your frontend then you
must close all bound forms and reports as well as any recordsets you
may have open.

You can verify this during testing by looking for the presence of the
ldb file in the backends folder.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
Back
Top