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
LVL 5
bfuchsAsked:
Who is Participating?
 
bfuchsAuthor Commented:
Hi Experts,

Not sure what was causing it in Access, but I converted it to a SQL pass-through query as below and it worked.
UPDATE EmployeesUnitstbl SET EmployeesUnitstbl.Unit = 'RN – GROUP HOME'
WHERE EmployeesUnitstbl.Unit='RN - LTC'
and employeesid in ( SELECT EmployeesUnitstbl.EmployeesID
FROM Employeestbl INNER JOIN EmployeesUnitstbl ON Employeestbl.ID = EmployeesUnitstbl.EmployeesID
WHERE Employeestbl.Title='rn' AND EmployeesUnitstbl.Unit In ('MRDD','ddso','group home'))

Open in new window

Thanks,
Ben
0
 
Gustav BrockCIOCommented:
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
0
 
ste5anSenior DeveloperCommented:
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.
0
 
Vijaya KumarCommented:
check whether file was already opened my manually or application it self. it will also cause that problem.
0
 
bfuchsAuthor Commented:
got a workaround.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.