Pamela Brooker
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can't tell without your code.
But this is a classic; something/someone is holding/changing the record while you try to update it.
But this is a classic; something/someone is holding/changing the record while you try to update it.
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 :)
Thanks. Happy to close this now :)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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?