Others

Fix an Access 2010 INSERT Lock on a SQL Server Table

Nimra MalikNimra Malik Nov 25, 2026 869 views

Question details

Identify why an Access 2010 INSERT is followed by a SQL Server SELECT timeout.

Fix an Access 2010 INSERT Lock on a SQL Server Table
Product
Microsoft Access 2010 and SQL Server 2005
Device & OS
not provided
Scenario
An Access front end inserts a record into a linked SQL Server table and then runs a SELECT against it.
Observed behavior
The later SELECT times out because the table appears to remain locked. The process commits correctly in Access 2000, and only one user is connected.
Before you start

Identify the INSERT and SELECT statements, the linked SQL Server table, and any forms or VBA code involved. Make sure you can inspect active sessions in SQL Server Management Studio with an account that has the necessary permissions.

Solution 1Recommended

Identify the blocking session and isolate the Access objects

Use this approach to find what holds the lock before changing the application.

1
Inspect active sessions

Reproduce the timeout, then run EXEC sp_who2 in a SQL Server Management Studio query window. Check the blocked session and the session identified in the BlkBy column.

2
Check the wait details

In a new query window, query sys.dm_exec_requests for the blocked session and inspect blocking_session_id, wait_type, and wait_resource. Use these details to identify the blocking request and resource.

3
Test the statements alone

In Access, create a minimal VBA procedure that runs only the INSERT and subsequent SELECT. Compare its behavior with the full process.

4
Inspect forms and subforms

If the minimal procedure succeeds, close or disable open forms and subforms one at a time, then repeat the full process. Inspect their record sources and controls, including combo boxes, for activity involving the affected table.

One user can still have blocking sessions: A single Access user can have multiple database connections, so the blocking session may belong to the same user.
Free Microsoft Office alternative

Use WPS Office for documents and spreadsheets

WPS Office is a free, lightweight alternative for everyday document and spreadsheet work, with a familiar interface and support for common Microsoft Office formats to make migration easier. It does not repair Access-to-SQL Server connections or replace an Access database application.

Work with documents and spreadsheets in a familiar interfaceOpen and edit common Microsoft Office formats, including DOCX and XLSXReview spreadsheet data alongside your database troubleshooting workUse a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

How can I find which session is blocking the SELECT?

Run EXEC sp_who2 in SQL Server Management Studio and check the BlkBy column. Then inspect blocking_session_id, wait_type, and wait_resource in sys.dm_exec_requests while the SELECT is waiting.

Why can blocking occur when only one user is connected?

One Access user can have multiple SQL Server sessions. A form, subform, query, or transaction on one connection can block a request on another.

Should I use a VBA transaction for a single INSERT?

Not necessarily. Test the INSERT without an explicit VBA transaction if it does not need to be atomic with other statements. If a transaction is required, use the correct DAO Workspace and explicitly commit or roll it back.

Can an Access form cause the SQL Server lock?

A form or subform can participate in the activity that causes blocking. Close or disable forms one at a time and retest, then inspect the record sources and controls of any form associated with the problem.

Does a pass-through query always fix the lock?

No. A pass-through query sends SQL directly to SQL Server, but other sessions or open transactions can still cause blocking. Create one through Query Design and select Pass-Through to compare its behavior.