Microsoft Access combines compacting and repairing a Database file into a single process.
Compacting an Access Database
If you delete data or objects in an Access Database, or if you delete objects in an Access Project , the file can become fragmented and use disk space inefficiently. By compacting the Access file, it makes a copy of the file and rearranges how the file is stored on your disk. Compacting a previous version Access Database will not convert it to the Access 2002 - 2003 format.
Compacting optimizes the performance of both Access Databases and Access Projects.
Caution: When you compact a Microsoft Access file located on a volume that uses the NTFS file system, Access removes the existing file and replaces it with the compacted file.
Repairing an Access Database
In most cases, Microsoft Access detects whether an Access file is damaged when you try to open it and gives you the option to repair it at that time. If the current Access file contains a reference to another Access file that is corrupt, Access does not attempt to repair the other file. In some situations, Access may not detect that a file is damaged. If an Access file behaves unpredictably, compact and repair it.
Access can repair:
- Corruption in a table in an Access database.
- Missing information about the structure of an Access file's Visual Basic for Applications (VBA) Project.
- Corruption in a form, report, or module.
- Missing information that Access needs to open a particular form, report, or module.
To help prevent corruption of Access files, follow these guidelines:
- Compact and repair Access files regularly. You can specify that Access compact a file automatically when you close it.
- Back up your Access files regularly.
- Avoid quitting Access unexpectedly. For example, do not quit Access suddenly by turning off your computer.
- If you are experiencing network problems, avoid using a shared Access database located on a network server until the problems are resolved. If possible, move the Access database to a computer where you can access it locally instead of over the network.