Locked lesson.
About this lesson
Repair and fix errors in a database.
Exercise files
Download this lesson’s related exercise files.
14.03 compact-and-repair - Exercise.docx42.8 KB 14.03 compact-and-repair - Exercise solution.docx
45 KB TechGurusTicketing35.accdb
2.7 MB TechGurusTicketing35 - Complete.accdb
956 KB
Quick reference
Compact and Repair
Use Compact and Repair to repair and fix database issues.
When to use
We use Compact and Repair to remove unwanted code, wasted space, orphaned objects, and other items that are taking up space and making the database larger than it should be.
Instructions
Compact and Repair
Over time, a database can become bloated and broken. When we are working in tables and deleting records, the space isn't always automatically reclaimed by Access. This can lead to lots of unnecessary pieces of code hanging around in the .accdb file. This can cause the database to grow larger and sometimes break.
It's important we are aware of the tool available in Access to help with this.
We can use Compact and Repair to fix our database.
Access will normally prompt us to fix errors. However, that doesn't always happen. So, it's a good idea to set up a repair schedule to catch issues early. It's good to set this up as part of a regular maintenance schedule.
To compact and repair the database we must open it for exclusive use.
- From the File tab, click Open.
- Browse to the folder where the database is located.
- Select the database file and click the drop-down next to Open.
- Select Open Exclusive.
- From the File tab, select the Info page and click Compact and Repair.
Compact on Close
We can set Access to run a compact every time we close the application.
- Click the File tab and select Options.
- From the Current Database page, click Compact on Close.
Lesson notes are only available for subscribers.