Compact Current Database

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I close the database I have a function that compare the last compacted
file size against the current size. If this the last one is bigger than more
20%, the compact function of current database should be start.
Question,
How can I compact automatically my database by programming.
Thanks
José
 
I use the following sequence:

Kill SavedDBName to remove the previous backup
FileCopy DBName, SavedDBName to backup the live DB
DBEngine.CompactDatabase DBName, NewDBName to compact the live DB to a
compacted version
Kill DBName to remove the uncompacted DB
Name NewDBName as DBName to rename the compacted DB to make it the live one.
Someone more expert than I may suggest a better method.

DJW
 
Back
Top