Compact database

J

Jasper Recto

Is there a way to compact the database everytime the exit button is clicked?

Thanks,
Jasper
 
J

John W. Vinson

Is there a way to compact the database everytime the exit button is clicked?

Thanks,
Jasper

In A2003 or 2007 you can set the database's Compact on Close property to
Yes... BUT DON'T DO IT. It's buggy, can corrupt your database, wastes time and
(with a properly designed database) should not be necessary. Why do you feel
that you need to do so? How big is your database, and how fast is it
growing... and why?
 
P

Pete D.

Sure is, check the current database options...now should you, I say no.
Anytime you run compact you run the risk of damaging the file or someone not
having the correct rights for the file system and leaving the file in a
unknown condition. Better to do it when needed and by someone that you know
has enough rights to make sure it works right. I usually (I'm honest,
should be always) make a backup of it before compacting. Think of it this
way, would you take all your paper personal files in the file cabinet, stick
them in a copier and as the original comes out of the copier shred them
without checking the copy first. So much for that double page feed that
missed a page or the jam that didn't make it through the machine. All it
takes is a bad network connection, a user killing/turning off their machine
in the middle of it or a disk error and your latest changes are gone.
Recommend make backup, then compress/repair, check it and keep the backup
for at least a week. Now if it is just your personal video tape collection
data file...me I still wouldn't but that's just me...Pete D.
 
Top