Link to home
Start Free TrialLog in
Avatar of bfuchs
bfuchsFlag for United States of America

asked on

cant run update sql due to lock violations

Hi Experts,
I'm trying to update a SQL table thru Access and getting the attached error, "cant update..due to lock violations", however there should be currently no users on the system, any idea whats causing it?
below is the SQL
UPDATE dbo_EmployeesUnitstbl INNER JOIN (SELECT dbo_EmployeesUnitstbl.EmployeesID
FROM dbo_Employeestbl INNER JOIN dbo_EmployeesUnitstbl ON dbo_Employeestbl.ID = dbo_EmployeesUnitstbl.EmployeesID
WHERE (((dbo_Employeestbl.Title)="rn") AND ((dbo_EmployeesUnitstbl.Unit) In ("MRDD","ddso","group home"))))
 AS a ON dbo_EmployeesUnitstbl.EmployeesID = a.EmployeesID SET dbo_EmployeesUnitstbl.Unit = "RN – GROUP HOME"
WHERE (((dbo_EmployeesUnitstbl.Unit)="RN - LTC"));

Open in new window

Untitled.png
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Mostly likely that other "user" is yourself - some other code or the current form.
So double-check that.

Or, you may be able to use VBA for the update and use the simple technique described here:
Handle concurrent update conflicts in Access silently
Check the indices on your table (server side). There should exist on on (Unit, EmployeeID), If EmployeeID is the primary key, then test (Unit) only.
Avatar of Vijaya Kumar
Vijaya Kumar

check whether file was already opened my manually or application it self. it will also cause that problem.
ASKER CERTIFIED SOLUTION
Avatar of bfuchs
bfuchs
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bfuchs

ASKER

got a workaround.