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 6
bfuchsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bfuchsAuthor Commented:
got a workaround.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.