CompactOnClose Property

  • Thread starter Thread starter Anthony
  • Start date Start date
A

Anthony

Is there a way to use VBA to programatically enable/disable the
"CompactOnClose" property of an external database?
 
CompactOnClose is an application property, not a database property. You'd
set it using

Application.SetOption "Auto Compact", -1

Note, though, that it doesn't do anything with external databases: it only
applies to the database you've currently got open.
 
Interesting. I know that it's an Application property, which you can set
through Application.SetOptions("Auto Compact"): I didn't realize it was also
a database property.
 
Okay, thank you!

Now how do I programmatically cause that database to bypass startup
(AutoExec Macro and Startup object)?
 
How are you trying to open the database?

If you're trying to use Automation, take a look at the kludge approach
outlined in section "Bypassing Startup Settings When Opening a Database" in
http://support.microsoft.com/kb/147816/ (Don't worry that it says Access 97:
it applies to all versions). The reason I call it a kludge is that it uses
SendKeys, which is seldom recommended in product grade applications.
 
thank you -- I will try it

Douglas J. Steele said:
How are you trying to open the database?

If you're trying to use Automation, take a look at the kludge approach
outlined in section "Bypassing Startup Settings When Opening a Database"
in http://support.microsoft.com/kb/147816/ (Don't worry that it says
Access 97: it applies to all versions). The reason I call it a kludge is
that it uses SendKeys, which is seldom recommended in product grade
applications.
 

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

Back
Top