Have you checked the Help files under CompactDatabase??
Copies and compacts a closed database, and gives you the option of changing its version, collating order, and encryption.
Syntax
expression.CompactDatabase(SrcName, DstName, DstLocale, Options, password)
expression An expression that returns a DBEngine object.
JR