CompactDatabase.mdb (expert)

Please consider donating $1 per sample downloaded, find out why here
Download
CompactDatabase.zip
Access 97 (46 KB)
This sample illustrates how to compact the current database 
programmatically.  It  assumes that the tables reside locally.  (To 
compact a Back-end database, see my sample "CompactBackEndDB.mdb".)  

Overview:
1) Create a new, temporary database
2) Copy several pre-created forms, macros and modules to this temp 
database
3) Close database and launch temporary database with the /x switch 
which initiates the compact process.
4) After compacting is done, close temp database and relaunch main 
database

This can be used to safely duplicate the buggy "Compact on Close" 
feature of Access 2000, because it makes a back-up of the database
 before compacting it.  If anything goes wrong, you can easily recover 
the uncompacted database.

 

Feedback

 

Need Winzip?

Return to Main Page