To programmatically perform data compaction on a database file, include COMPACT_DB=source db; dest db; sort order
in the list of attributes (lpszAttributes argument) of the SQLConfigDataSource function. In this function, source db is the full path to the Microsoft Access database to be compacted and dest db is the full path for the compacted Microsoft Access database. When compacting a password-protected file, you must enter a password and user ID in the list of attributes for SQLConfigDataSource.
This operation runs the standard Microsoft Access compaction process on the database. To perform the same process through the Setup dialog box for a Microsoft Access data source, double-click the ODBC icon in the Control Panel to access the ODBC Data Source Administrator.