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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automating database compact

Status
Not open for further replies.

DoniFromMars

Programmer
Aug 10, 2006
23
0
0
US
I'd like to compact my database at a specific time every night without having to do it manually from the menu.
VBA has 'docmd.RunCommand acCmdCompactDatabase' which looks promising but you can’t compact the db that is running the code and I can't find where to specify a different db.
Help!

 
You can start Access with a command line option "/Compact" to compact and close the database. You can use any of a number of different scheduling applications to perform this.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Took me a while to find it but I have had a lot of luck using faq705-2852

--Dan
Whenever you find yourself on the side of the majority, it is time to pause and reflect.
Mark Twain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top