Access desktop database files that are shared over a network might sometimes get corrupted. If this happens, it usually impacts the design and not the data. However, if you do lose data, it is usually limited to the last action of one user. When an Access desktop database file gets corrupted, you might be able to partially fix it with the Compact and Repair process. The compact process does not compress your data — it makes your database file smaller by eliminating unused space. The Compact and Repair Database command can also help improve performance of your database.
Note: This article doesn’t apply to Access web apps – the kind of database you design with Access and publish online. See Create an Access app for more information.
When you try to open a corrupted database file, Access prompts you for an automatic file repair process and if the process is only partially successful, Access keeps track of objects that were not repaired in a table named MSysCompactErrors. If you have a previous backup before the database was corrupted, you can use the MSysCompactErrors table to decide which objects to import into your repaired database.
Splitting a database can help prevent corruption of database files and limit the loss of data by keeping the data in a separate file that users do not access directly.
Note: If you compact and repair a previously published Access web database, remember to synch the database with the server after you complete the compact and repair process.
For more information about how to protect data with backup and restore processes.
Before you run the Compact and Repair process
Make a backup of the database:
On the File tab, click Save.
Under File Types, click Save Database As.
Under Advanced, click Back Up Database.
Note: If you have multiple users, notify other users so that they can avoid using the database while you run the compact and repair.
Get permissions to run a compact and repair operation: If you are using an earlier version database file and are part of a workgroup, you might be unable to compact and repair the database on your own. If you do not have sufficient permissions and you need to compact and repair a database, contact your workgroup administrator for assistance.
Set automatic compact and repair when a database closes
You can also set the compact and repair process to run automatically each time you close a database. In multiuser databases, you might not want to set this option, because it can momentarily disrupt database availability. This process affects only the database that is currently open.
Note: This option is not available for an Access web app.
On the File tab, click Options.
In the Access Options box, click Current Database.
Under Application Options, select Compact on Close.
Manually compact and repair an open database
Important: Before your run the compact and repair process make sure that no one is using the database files.
On the File tab, click Info > Compact and Repair Database.