Ashwin Nirmul
Ashwin Nirmul

Reputation: 71

MS Access Error 3188: Could not update; currently locked by another session on this machine

I have a form bound to a table with a long text field (form_conversationDetail).

I can add and then edit and save the same record until the number of characters in the field goes over 2000.

After that, I start getting the following when I attempt to save the record:

Error 3188: Could not update; currently locked by another session on this machine.

I have a parent form (form_conversations) that provides a list of records that allow the user to choose which conversation to edit in form_conversationDetail.

Before opening form_conversationDetail, I tried setting Dirty to False.

Upvotes: 2

Views: 1844

Answers (2)

Greg
Greg

Reputation: 1

I have an Access database with a table called "Post" and a field called "body" which was long text RTF. I was constantly getting:

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

To reproduce

  1. Create a table called Post with a long test field of type RFT.
  2. Create two separate forms that access Post.Body
  3. Open one form, and add more than 2000 characters (not sure about the threshold, but only occurs with large data) to Post.Body. Navigate to a different record and then back
  4. Open a second form that displays Post.Body
  5. Navigate both forms to the same record with the long text. Try editing the text and then saving (navigating to another record)

Observed

  1. "Could not update; currently locked by another session on this machine"
  2. Have to restart Access to fix.

Other Scenarios

  1. The same issue happens if there is a form and a report that both have the RFT control and they point to the same record, and you try to edit the text in the form.
  2. If the second form edits the same record, but does not have the RTF control, there is no problem.
  3. If the report points to the same record, but does not have the RTF control, there is no problem.
  4. I tried with the forms both in the same database as the tables as well as with the table linked from another database, and the same problem.
  5. I tried the various lock options under "Options" and had the same problem.

Conclusion

This seems like a Microsoft Access bug. The fact that a report, which can't even edit the data and should be doing a non-locking read causes the issues, suggests it's a bug.

Fix

I have to make sure no one opens a second screen that views the same record with the RTF control while someone is editing the RTF value.

I tried refresh and other possible fixes I found online, but for whatever reason, I still had the problem.

Upvotes: 0

Ashwin Nirmul
Ashwin Nirmul

Reputation: 71

I added the following statement right before I save which seems to have resolved the situation:

DBEngine.Idle dbFreeLocks

Upvotes: 3

Related Questions