Compacting DB at server startup

  • Thread starter Thread starter Ian Joseph
  • Start date Start date
I

Ian Joseph

I have an Access 2002 DB that bloats, the database is used continually so
manually compacting is tricky, but the server is restarted on a weekly
basis. I am thinking about having a batch file or something that runs on
startup to compact the database knowing that straight after the reboot no
one will be using it.

Has anyone done this before? Is there a batch file command that I can use to
compact that I can have run at startup?

Any help appreciated.

Regards

Ian
 
I don't use 2002... but I thought if you close a 2002 database it compacts
automatically? If this is the case then when your server shuts down, so
should 2002 and therefore compact?

Tom.
 
Yes, it can be compacted using a batch file command, if the server has Access on it.

"<path>\msaccess.exe" "<path>\database.mdb" /excl /compact

Just be aware, it may be possible for your users to get the file before the batch file is
run from the Startup menu on the server. You will have to make sure no one attempts this
before the server is fully up and ready. Also, that in order for the Startup menu to run
this batch file, the Server will have to be logged onto locally. This can be accomplished
with AutoLogon so that the server will always logon when started.
 
Back
Top