Compact an Access Applicaton by checking Compact on Close

T

tomlebold

Is it risky to automatically compact an Access MDB when a user closes
an application.
That is automatically compacting by checking Compact on Close on the
Option form in the Tools menu.
Compacting an Access application can corrupt an Access MDB.
 
D

Douglas J. Steele

A properly designed Access application should be split into a front-end
(containing the queries, forms, reports, macros and modules), linked to a
back-end (containing the tables and relationships). Realistically, it's only
the back-end that needs to be compacted regularly. Since chosing the
"Compact On Close" option only impacts the front-end, it's of limited value.

I question your comment, though, that "Compacting an Access application can
corrupt an Access MDB." While that's true, doing anything with an Access MDB
is, theoretically, capable of corrupting it. Compacting is a fundamental
part of proper maintenance of Jet databases, and should not be avoided.
 
D

David W. Fenton

I question your comment, though, that "Compacting an Access
application can corrupt an Access MDB." While that's true, doing
anything with an Access MDB is, theoretically, capable of
corrupting it. Compacting is a fundamental part of proper
maintenance of Jet databases, and should not be avoided.

But it should be done only when needed. If you have Compact On Close
ON and you get an error indicating corruption, there's no way to
close Access in an orderly fashion (in order to make a backup)
without the compact triggering (you can force quite through Task
Manager, of course, if you remember). The result could possibly be
that you lose data that you would have been able to recover from the
MDB before the compact.

Thus, I think it's very, very unwise to ever set Compact On Close to
ON.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top