CompactDatabase Statement Example

The following code compacts a database called C:\PUBS.MDB and keeps a backup copy of the original database.  The new database has the same locale as the source database, but is encrypted.

CompactDatabase "C:\PUBS.MDB","C:\PUBSNEW.MDB",,DB_ENCRYPT
...
Kill "C:\PUBS.BAK"
Name "C:\PUBS.MDB" As "C:\PUBS.BAK"
Name "C:\PUBSNEW.MDB" As "C:\PUBS.MDB"