Access repairs a damaged database through Compact and Repair. Backup the file first because repair can truncate data from damaged tables. Select File, Info and Compact & Repair Database. Partial repair logs unrepaired objects in the MSysCompactErrors table. Check your data after every repair.
Your Access database opens slowly or shows errors. Microsoft ships one built in repair command that also shrinks unused space.
Steps follow the Microsoft Support page on compacting and repairing a database.
How to Prepare Before a Repair?
- Backup. Copy the database first. Microsoft states repair can truncate data from damaged tables.
- Exclusive access. Notify other users and ask them to close the file during the repair.
- Permissions. Confirm you have sufficient file permissions. Ask your system administrator otherwise.
How to Repair an Open Database?
Select File, Info and Compact & Repair Database. Access saves a compacted copy in the same folder.
How to Repair a Closed Database?
- Open Access and choose Blank Database.
- Select File then Close.
- Go to Database Tools and select Compact and Repair Database.
- Choose your database file.
How to Compact Automatically?
Open File, Options and Current Database. Tick Compact on Close under Application Options and reopen the database. Access applies the setting to the current database only.
What Happens After a Corrupted File Prompt?
- Select Yes. Access starts the repair.
- Full repair. Access shows a success message. Check the data.
- Partial repair. Access logs unrepaired objects in the MSysCompactErrors table. Use it with your backup to recover objects.
Microsoft states corruption is uncommon. It occurs mostly when many users edit a shared network file, especially Long Text fields. Compacting reclaims unused space and does not compress your data. Related reading: how to solve a full Outlook mailbox and why Excel warns about a file extension.
Frequently Asked Questions
How do I Repair an Access Database?
Select File, Info and Compact & Repair Database after you backup the file.
Does Compact and Repair Delete Data?
Repair can truncate data from damaged tables. Microsoft advises a backup first.
What is MSysCompactErrors?
MSysCompactErrors is a table where Access logs objects that a partial repair could not fix.
Does Compacting Compress My Data?
No. Microsoft states compacting reclaims unused space and does not compress data.
Key Takeaways
- Compact and Repair is the built in Access repair command.
- Backup the database before every repair.
- Partial repairs log objects in MSysCompactErrors.
- Compact on Close shrinks the current database automatically.
- Shared network files carry the highest corruption risk.
Sources and References
Facts follow Microsoft Support.
- Compact and repair a database (Microsoft Support) support.microsoft.com