Microsoft Access displays the Write Conflict dialog box when you and another person are attempting to write to the same record in the database at the same time. The default locking strategy (called pessimistic locking) is to grant ownership of the lock to the first person to attempt to write to the record. The other person can save the record before you do, but you can decide what happens because you own the lock. There are two main reasons why a write conflict occurs:
-
You have two objects (such as a table and form) open at the same time in the same Access database and both objects are attempting to write to the same record. In this case, the other person is you. The first object that attempts to write to the record owns the lock.
-
The Access database is shared, and another person is attempting to write to the same record. In this case, the first person that attempts to write to the record owns the lock.
Resolve the conflict
Access gives you three choices:
-
Save Record You can overwrite the changes the other person made. Because you were the first to edit the record, you own the lock. The other person most likely loses their changes. If you can, avoid using this option.
-
Copy to Clipboard The entire record is copied to the clipboard with the changes you have made, and then the changes made by the other person are displayed in the record. You can accept their changes or decide to overwrite their changes based on what is saved in the clipboard.
-
Drop Changes Even though you own the lock, you let the other person keep their saved changes.
Advanced information
You can control this behavior programmatically. For more information, see RecordLocks Property and Unexpected write conflict error occurs when you close a form in Access.
No comments:
Post a Comment