Avatar of Pamela Brooker
Pamela Brooker
Flag for Australia asked on

Trying to Update a different record from point of focus but always get ERR=3218 Could not update; currently locked

[First EE question here - so hoping the below is clear enough]

Wondered why no update was happening from a rather simple update statement in my variable: vMySQL.
Printed out the contents of vMySQL and applied the same update statement directly to the database - and it worked perfectly, so there is nothing wrong with the statement
 Found the error using the below.
 db.Execute vMySQL, dbSeeChanges + dbFailOnError

Have tried repair database, turning pc off and on, various lock settings in "Tools>>Options>>Advanced Tab", putting DBEngine.Idle dbFreeLocks just before the execute statement but nothing changes. Always get this error.  

Any ideas from anyone?  Any help would be much appreciated
Microsoft Access

Avatar of undefined
Last Comment
Gustav Brock

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Gustav Brock

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Pamela Brooker

ASKER
Thanks Gustav for looking into my issue.
Wondering if there is no "true" lock as I was able to stop the processing during debug mode, at the point where the execute statement, is and manually run the update statement successfully.  I thought that since I could do that there that this would mean that there was no true lock?

Hoping you have some more ideas?
Gustav Brock

Can't tell without your code.
But this is a classic; something/someone is holding/changing the record while you try to update it.
Pamela Brooker

ASKER
I stand corrected!  Just had my morning coffee :). I must have missed something last night.  Actually the whole table is locked but somehow gets released later in the code. And ... Me.Dirty is True - so you are right and that is a relief.  Just executed another save and all works now.  Now just have to find where unexpected change is happening.

Thanks. Happy to close this now :)
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
SOLUTION
Gustav Brock

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.