Fix Microsoft Access Compact and Repair When the Database Is in Use
Question details
The user needs to run Compact and Repair on an Access database that is reported as already in use.

- Product
- Microsoft Access
- Device & OS
- Windows 10
- Scenario
- Compact and Repair is started on a database on a standalone computer.
- Observed behavior
- Access intermittently reports that the database is already in use.
Locate the database file and its folder in File Explorer. Close any applications that may have an open connection to the database before checking for a lock file.
Remove a stale lock file and run Compact and Repair
Use this method when a leftover lock file may be preventing exclusive access to the database.
Close Microsoft Access and any other applications connected to the database. Open Task Manager and check that no Access process is still using it.
In File Explorer, open the database folder and look for a file with the same name and an .laccdb extension. Older .mdb databases use an .ldb lock file.
If you have confirmed that no process or user is using the database, right-click the lock file and select Delete. Do not delete the .accdb or .mdb database file.
Start Access, select File > Open > Browse, select the database, and use the arrow next to Open to choose Open Exclusive.
With the database open, select Database Tools > Compact and Repair Database. Check whether the operation finishes without the in-use message.

Import database objects into a new Access database
Use a new database if Compact and Repair still cannot run or the original database appears damaged.
Work with exported Access data in WPS Spreadsheets
WPS Office is a free, lightweight alternative for everyday office work, with a familiar interface and compatibility with common Microsoft Office formats. Export Access tables to Excel to review spreadsheet data in WPS; WPS does not repair or replace an Access database.

Frequently Asked Questions
What is the .laccdb file next to my Access database?
It is a lock file Access uses to track database access. Delete it only after confirming that no user or process is using the database.
How do I open an Access database exclusively?
In Access, select File > Open > Browse, select the database, and choose Open Exclusive from the arrow next to the Open button.
What if there is no lock file but Compact and Repair still fails?
Check Task Manager and other applications for active database connections. If the problem continues, create a blank Access database and import the objects through External Data > New Data Source > From Database > Access.
Will importing objects restore every database setting?
Not necessarily. After importing, test the objects and check relationships, linked tables, references, and startup settings; some may need to be recreated or adjusted.
Can WPS Office repair an Access database?
No. Use Microsoft Access for Compact and Repair or object recovery. You can export table data from Access to Excel and open the resulting spreadsheet in WPS.




