Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to: Tell Access to Compact and Repair Database on Close 1

Status
Not open for further replies.

Ogart

Technical User
Mar 26, 2003
104
US
Is there a way to tell Access to compact/repair database in VBA? You can do it easily enough when the database closes (tools/options/general), but I'm curious if there's a VBA command that'll do it. Not a huge earth shattering deal if I can't. Just curious in the event I've got a project down the road that won't get closed down much.

I know, I know. Curiousity killed the cat. But I can't help it.

Have a GREAT weekend, everyone!
Chris

-->Just because you can, doesn't mean you should.
 
Hi NPSHr,

I have a Frequently Asked Question at faq705-2852 which allows you to specify how large you want to allow your DB to grow before compacting on close. Otherwise:

Compact On Close
Application.SetOption ("Auto Compact"), 1

Don't Compact On Close
Application.SetOption ("Auto Compact"), 0

Bill

 
Shine on you crazy diamond. Awesome. Thanks!

-->Just because you can, doesn't mean you should.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top