How to Compact and Repair an Access 2007 Database?

Prevent Access Database Corruption

Coworkers Discussing Data on Digital Tablet

Thomas Barwick/Getty Images

Over time, Microsoft Access 2007 databases grow in size and use disk space unnecessarily. Access creates hidden objects for tasks, and those hidden objects sometimes remain in the database after they are no longer needed. Similarly, deleting a database object may not release the disk space it occupied. Eventually, performance suffers.

Additionally, repeated modifications to the database file may result in data corruption. This risk increases for databases shared by multiple users over a network. For both these reasons, it's a good idea to proactively run the Compact and Repair Database tool to ensure the consistency of your data. If your database is corrupted, Access prompts you to run the Compact and Repair command.

Running Compact and Repair on an Access Database

  1. Instruct other users to close the database. You must be the only user with the database open to run the tool.
  2. Click the Microsoft Office button.
  3. From the Office menu, choose to Manage in the left column, followed by Compact and Repair Database to open the "Database to Compact From" dialog box.
  4. Navigate to the database you want to compact and repair and then click the Compact button.
  5. Provide a new name for the compacted database in the Compact Database Into dialog box and click the Save button.
  6. Verify that the compacted database works appropriately.
  7. Delete the original database and rename the compacted database with the original database's name. (This step is optional.)


Remember that compact and repair creates a new database file. Therefore, any NTFS file permissions you applied to the original database do not apply to the compacted database. It's best to use user-level security instead of NTFS permissions on your database for this reason.