Error - Could not update; currently locked by another session on this machine

VPK_Access

Registered User.
Local time
Tomorrow, 01:14
Joined
May 15, 2011
Messages
36
HI,

I have a system developed in Access 2003. When I am updating some records it gives me the error "Could not update; currently locked by another session on this machine". This error comes only when I update data on some records in the database.

While searching on the access programmer issues, I found a similar query, which said that the DAO.Recordset should maybe open. I checked my code and ensured that it is closed.

Could anyone help me in telling why this error comes and why only for some record updates.

Thanks for any help in advance.
 
Don't hold me to this, but it seems that I remember something or other about not using the "save" correctly. It was an error in access that locked the record because it was not actually instructed to save. I know that I read this thread on here somewhere. :) I just can't seem to pin it now.

Other things that I can think of ...

- you left a dirty form?
- you have established a record lock in vb and did not release?
- you created a record or attempted to create a record that cannot be updated and thus is locked

That will give you some "google" ideas anyway.

(Pssttt ... did you reboot the machine and get the error again? I always troubleshoot by reboot first. Memory is not finite, and easily corruptible during my own creations and testings. I am bad about not releasing it during project development.)
 
Hi,
Thanks a lot for the update.

I did some debug on the program and it seems that this error happens when I try to enter a large size of data from a string to a memo field. I have attached the code as mentioned below. When the Length of the string(after Msg '3') shows beyond 1700-1800 length, this error comes. Does this have anything to do with the limit of a string? I am badly stuck Any help would be really helpful.

**************************************************************


If CurrStr2 = "" Then
CurrStr1 = " " & Appdt & " UserID:" & UsrNm & " Original Status: " & CurrStr
Else
CurrStr1 = " " & CurrStr2 & " " & Appdt & " UserID: " & UsrNm & " New Status: " & CurrStr
End If

MsgBox "3"
MsgBox Len(CurrStr1)

'Append date and current status to the history field
StrDt2 = "UPDATE [FD] SET [Agreed Action / Follow up History] = '" & CurrStr1 & "' WHERE ([FD].ID)=" & FindID & ";"
DoCmd.RunSQL StrDt2
MsgBox "Last Msg"
MsgBox StrDt2
 

Users who are viewing this thread

Back
Top Bottom