Skip to content
Auscultby NBIT
EN
Free diagnostic

Access error reference

Access error 3197: another user is changing the same data (fix)

Two people opened the same record; the second to save gets error 3197. It also appears with no second user, when the application itself changes a record already open in a form.

The message

Microsoft Visual Basic box: “Run-time error '3197': The Microsoft Access database engine stopped the process because you and another user are attempting to change the same data at the same time.”
The real error box, captured in Access for Microsoft 365, in English: the code updates a record another connection changed in the meantime (optimistic locking).

The Microsoft Access database engine stopped the process because you and another user are attempting to change the same data at the same time.

Access for Microsoft 365, English

On a French Access: « Le moteur de base de données Microsoft Access a arrêté le traitement parce que vous et un autre utilisateur tentez de modifier les mêmes données en même temps. »

Microsoft adds: another user changed the data between the moment you called the Edit method and the moment you called Update, with optimistic locking.

Where it shows up

In code between rs.Edit and rs.Update, in a form when saving a record, and often on SQL Server linked tables when the row changed on the server since it was read.

Common causes

  • two users on the same record: the second saves a version the first has just changed;
  • the application against itself: a form shows a record being edited while the code updates it through a Recordset or a query;
  • a trigger or a server-computed value changes the row after saving, and Access no longer recognises its version;
  • a SQL Server linked table with empty bit fields or floating-point numbers, which the row comparison handles badly.

How to reproduce and check it

  1. Replay alone on a copy: if the error remains, the application gets in its own way.
  2. In the button's code, look for an update of the open form's table (CurrentDb.Execute, rs.Edit) while the record is being edited.
  3. For a SQL Server linked table, open it on its own and edit the same row: if the error returns, look at the table's structure on the server.

How to fix it

Save the form's record before any update in code, then refresh the form: If Me.Dirty Then Me.Dirty = False, the update, then Me.Requery. Better still, change the record through the form itself (Me!Status = "Paid") rather than through a separate query.

For a SQL Server table, a rowversion (or timestamp) column lets Access recognise a row's version; also give bit fields a default value. Relink the table after the change.

What Auscult reports

The analysis works alone, on a copy of the database: it does not reproduce two users on the same record. If the error appears during the analysis, the application gets in its own way, and the diagnostic records it with the form or button that raises it.

The Access error reference, code by code

Frequently asked questions

Should I switch to pessimistic locking?

Rarely. Pessimistic locking avoids the conflict by blocking the record, but then causes lock errors (3218) for others. Fixing the code that changes an already open record solves most cases.

Why does error 3197 appear after moving to SQL Server?

Because Access then compares rows before and after on the server. Empty bit fields, floating-point numbers and the lack of a rowversion column make that comparison unreliable.

Where are the other errors in your application hiding?

The diagnostic runs on your computer, on a copy of the application, without sending the data in your tables. The health grade and the summary are free.