How to Fix Microsoft Access Compact and Repair or File-in-Use Errors
Question details
The user is experiencing issues with Microsoft Access databases failing to compact and repair, remaining locked as 'in use', or failing to close completely.
- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Attempting to manage, repair, or close Access databases after a power interruption or recent Office update.
- Observed behavior
- Databases fail to execute the compact and repair function, files stay marked as 'in-use' locking out users, and the Access application continues running in the background even after the file is closed.
Before proceeding, ensure you have a backup copy of your database file and verify that no other network users are currently connected to the shared database.
Add the Database Folder to Access Trusted Locations
Configuring Trusted Locations resolves file lock and compact/repair bugs triggered by recent Office updates by marking the database directory as safe.
Recent Microsoft Office updates introduced a known bug that prevents Access databases from properly closing, compacting, or clearing their lock files. The official workaround is to explicitly add the folder containing your database to the Trust Center's safe list.
Launch Microsoft Access. Click on 'File' in the top-left corner, and then select 'Options' at the bottom of the left sidebar.
In the Access Options window, click on 'Trust Center' from the left pane, then click the 'Trust Center Settings...' button on the right.
Select 'Trusted Locations' from the left menu. Click the 'Add new location...' button at the bottom.
Click 'Browse' to locate the folder where your affected database is stored. Check the box that says 'Subfolders of this location are also trusted' if applicable, then click 'OK' on all dialog windows to save your changes.
Manually Clear the Access Lock File (.laccdb)
Sometimes, after a power interruption, the database lock file is not deleted automatically, preventing future access.
Looking for a reliable Office suite? Try WPS Office
If you are tired of troubleshooting complex software bugs or dealing with disruptive background updates, consider WPS Office for your document, spreadsheet, and presentation needs. It is a lightweight, highly compatible alternative that ensures smooth performance.
- 1. Download the Installer: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install the Software: Run the downloaded installer and follow the simple on-screen instructions to set up the software.
- 3. Start Working: Open WPS Writer, Spreadsheet, or Presentation to immediately begin handling your documents with full Microsoft Office format compatibility.

Frequently Asked Questions
Why does my Access database say 'file in use' when it's closed?
This happens when the .laccdb or .ldb lock file is left behind after an application crash, power interruption, or background task failing to close properly. Deleting this lock file manually or configuring Trusted Locations usually resolves the issue.
Is it safe to add a network drive to Access Trusted Locations?
Yes, provided the network drive is secured and accessed only by trusted members of your organization. You must first check the 'Allow Trusted Locations on my network' box in the Trust Center Settings before you can add a network path.
Why is the Compact and Repair tool failing suddenly?
Recent Office updates introduced a known bug affecting database operations and cleanup processes. Adding the database's storage folder to the Access Trusted Locations list is the official workaround recommended by Microsoft until a permanent patch is released.




