CompactOnClose

R

Ron Hinds

In our compiled .MDE application that we distribute to our customers, I have
set the CompactOnClose option. If the user exits via the "X" in the upper
right hand corner of Access, or Alt-F4, or File | Exit form the Access menu,
then the UI stays open during the Compact process, with a progress bar in
the status bar area that reads "Compacting". If, however, they use the Exit
button in my application, then the UI disappears immediately. The Compact
process still runs, but since the UI is no longer visible, the user assumes
the app is closed and shuts off their PC. What happens is the MDE never gets
compacted, and MDB's of varying sizes named db1, db2, etc. begin to appear
in the application folder. The problem is compounded when the users are
using Terminal Server, which many of our users do for performance reasons
(each user has their own copy of the MDE in this scenario). Our exit button
calls this code:

Application.Quit

Seems simple enough. Is there some other way I can close the app in code
that will keep the UI up until the compact is completed? Thanks!
 
D

Douglas J. Steele

Realistically, I'd recommend against using CompactOnClose. Presumably you've
split the application into a front-end (containing the queries, forms,
reports, macros and modules), connected to a back-end (containing the tables
and relationships), and it's only the front-end that you're talking about.
Front-ends should not need compacting that frequently, and it's actually
possible that compacting too often can cause problems.
 

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