bcooler
Programmer
- Jun 13, 2009
- 132
Hello all!
I have created a few multi-user 2007 databases. I have always chosen the "Compact and Repair" option on close to prevent bloat. However, on occasion, the .accdb file will be missing, but a "database.mdb" will appear causing everyone's file links to quit working until I rename the file.
After a bunch of searching I found out the following:
1.) This happens when multiple people are using the database and someone tries to compact it on close, causing the command to fail.
2.) Some suggest not to do this because problems like a full hard drive and not being the only person in the database could cause corruption. Their suggestion is to manually compact routinely.
3.) I know that I'm too lazy to remember to compact all these databases with any regularity.
With that said, can someone point me to a solution that is bulletproof? I'm not sure how to execute, but would a command line combined with a Windows scheduled task get the job done (at low usage times like 3AM)? I found this code at
but have no idea how to use it and if it will work.
Thanks!
I have created a few multi-user 2007 databases. I have always chosen the "Compact and Repair" option on close to prevent bloat. However, on occasion, the .accdb file will be missing, but a "database.mdb" will appear causing everyone's file links to quit working until I rename the file.
After a bunch of searching I found out the following:
1.) This happens when multiple people are using the database and someone tries to compact it on close, causing the command to fail.
2.) Some suggest not to do this because problems like a full hard drive and not being the only person in the database could cause corruption. Their suggestion is to manually compact routinely.
3.) I know that I'm too lazy to remember to compact all these databases with any regularity.
With that said, can someone point me to a solution that is bulletproof? I'm not sure how to execute, but would a command line combined with a Windows scheduled task get the job done (at low usage times like 3AM)? I found this code at
but have no idea how to use it and if it will work.
Code:
expression.CompactDatabase(SrcName, DstName, DstLocale, Options, password)
Thanks!