File Corruption & Recovery

Fix Microsoft Access Compact and Repair When the Database Is in Use

Nimra MalikNimra Malik Nov 22, 2026 868 views

Question details

The user needs to run Compact and Repair on an Access database that is reported as already in use.

Fix Microsoft Access Compact and Repair When the Database Is 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.
Before you start

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.

Solution 1Recommended

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.

1
Close database connections

Close Microsoft Access and any other applications connected to the database. Open Task Manager and check that no Access process is still using it.

2
Check for a lock file

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.

3
Delete only a stale 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.

4
Open the database exclusively

Start Access, select File > Open > Browse, select the database, and use the arrow next to Open to choose Open Exclusive.

5
Compact and repair

With the database open, select Database Tools > Compact and Repair Database. Check whether the operation finishes without the in-use message.

Remove a stale lock file and run Compact and Repair
If the lock file remains: A lock file can indicate an active connection. Recheck open applications and processes before attempting to delete it.
Free Microsoft Office alternative

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.

Review Access table data exported to Excel in WPS SpreadsheetsOpen and edit Microsoft Excel, Word, and PowerPoint formats, including XLSX, DOCX, and PPTXUse a familiar interface for a smoother move from Microsoft OfficeWork with a free, lightweight office suite
microsoft office alternative - wps office

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.