How to Fix Microsoft Access Error 3009: Record or Table Is Locked
Question details
The user encounters Error 3009 in Microsoft Access indicating a record or table is locked, typically occurring when running a macro a second time, leaving an orphaned .ldb file.
- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Running a macro multiple times or attempting to access a table while previous connections remain active.
- Observed behavior
- Access reports Error 3009. An .ldb lock file remains after closing the application, requiring a forced End Task via Task Manager, even with no other users connected.
Before proceeding, verify that no other users on your network currently have the database open, and ensure you know the folder location where your Access database file is stored.
Force Close Access Processes and Remove the Lock File
Use Task Manager to completely shut down stuck Access processes that are holding the database lock, then manually delete the orphaned lock file.
When Access fails to close properly, a background process may keep the database locked, preventing you from reopening it or running macros. Clearing the lock file (.ldb or .laccdb) forces the database to release all connections.
Right-click the Windows taskbar and select 'Task Manager', or press Ctrl + Shift + Esc on your keyboard.
Under the 'Processes' or 'Details' tab, locate 'MSACCESS.EXE' or 'Microsoft Access'. Select the process and click 'End Task' to force close it.
Open File Explorer and navigate to the folder where your database is stored. Look for a file with the exact same name as your database but with an '.ldb' or '.laccdb' extension.
Right-click the lock file and select 'Delete' to manually release the database lock.
Ensure Proper Macro and Recordset Cleanup in VBA
Modify your VBA code or macros to ensure all recordsets and database connections are explicitly closed after execution.
Looking for a Lightweight Alternative for Word, Excel, and PowerPoint?
While Microsoft Access handles complex databases, WPS Office is an excellent, free alternative for your daily document, spreadsheet, and presentation needs. It is lightweight, highly compatible with Microsoft Office formats, and easy to use.
- 1. Download the Installer: Visit the official WPS website and click the download button to get the latest version.
- 2. Install the Software: Run the downloaded installer and follow the on-screen instructions to complete the setup.
- 3. Open Your Office Files: Launch WPS Office and open your existing Word, Excel, or PowerPoint files without losing any formatting.

Frequently Asked Questions
What is an .ldb or .laccdb file in Microsoft Access?
It is a lock file created automatically when an Access database is opened. It keeps track of which users are currently accessing the database to prevent conflicting changes.
Why does the lock file remain after I close Access?
The lock file may remain if Microsoft Access crashes unexpectedly, if a background process is still holding a connection to the database, or if VBA code fails to release a recordset properly upon completion.
Can I prevent Error 3009 by changing my database settings?
Error 3009 is usually caused by unclosed connections or stuck processes rather than configuration settings. Ensuring proper VBA code cleanup and running the 'Compact and Repair Database' utility regularly can help minimize these issues.




