Compact Current Database

J

José

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é
 
D

DJW of HSL

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top