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

Compact using Scheduled Tasks

Status
Not open for further replies.

aarondewberry

IS-IT--Management
Jul 20, 2005
148
0
0
GB
Hi all

I have a macro in my database that refreshes every evening on a scheduled task. How do I get my database to compact at the end of the macro. Without using the compact on close option in tools!
Reason i can't use this option is because this database is multi user and i don't want it to compact everytime they go in and out of it.

Any ideas?
 
One way:

- create another scheduled task with a command line that takes the form:

[Location of Access EXE] [Location of database] /compact

e.g. "C:\Program Files\blah blah blah\msaccess.exe" "G:\dbs\db1.mdb" /compact

Note the quotes to allow for file paths with spaces in.

If the db is secured at a user level you'll need to add /wrkgrp [Location of MDW file]

Another way:

- use an Access-specific scheduling tool like the Handy Access Launcher to take care of your macro runs and compacts/repairs. It uses less system resources than Windows Task Scheduler too, and also adds other Access options, like running these tasks exclusively.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top