Database files can sometimes becomes corrupted or damaged. You can use Compact and Repair Database command to fix errors in Microsoft Office Access. When you compact and repair a web database which has been already published, then you should sync the database after finishing the compact and repair issue.
Why there is a need to compact and repair a database?
This article explains how this command can help you to prevent and correct the following mentioned below problems:
- Database files grow with use
- Database files can become corrupted
There is a very less chance to loss data in database file corruption. This corruption takes place when a user changes the data and the change is interrupted because of any reason. For examples- because of network service loss, Access indicates the database files as corrupted.
- Automatically compact and repair errors in a database when it closes
- Click Options on the File tab.
- Click Current Database in the Access Options dialog box.
- Select the Compact on Close check box under Application Options.
- Manually compact and repair a database
- Compact and repair errors in Ms Access database that you have open
- Click Info on the File tab and then click Compact and Repair Database.
- Compact and Repair a database that is not open
Note: You cannot perform a compact and repair operation if other users are currently using the database file. No one can use the database file while you run the compact and repair operation.
Get started Access but do not open a database.
Point on Info and then click Compact and Repair Database.
In the Database to Compact From dialog box, navigate to and double-click the database that you want to want to repair.
Create a desktop shortcut that compacts and repairs a particular database
You can create a shortcut on your desktop which you can easily use to compact and repair a specific database.
Verify the location of the MSAccess.exe file on your computer before you start. It is located in the following folder:
C:\Program Files\Microsoft Office\Office14
If you are unable to compact and repair a database from the above mentioned manual method then you can also use the MS Access Repair Tool to recover corrupted data and also it restores table structures such as primary keys, foreign keys, auto number, field size etc.