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

DatabasesMicrosoft AccessMicrosoft SQL ServerSQL

Avatar of undefined
Last Comment

8/22/2022 - Mon
Gustav Brock

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.
Vijaya Kumar

check whether file was already opened my manually or application it self. it will also cause that problem.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

got a workaround.