Rivercity Technology Services LTD Logo
HomeAbout Us
Technology Services
Icon showing a support technician
IT Support Services
Cybersecurity Risk Management at one predictable flat rate.
Icon of light bulbs on a laptop screen
IT Consulting
Business optimization through the smart use of technology.
Icon showing a hand holding a phone
Business Phone Services
VoIP Telephone solutions from RCT. 
Icon showing a database and a cloud
Backups & Recovery
Cloud & On Premise - ready to recover!
Icon showing computer code on a monitor
Software Development
Web & Mobile App development
Icon showing website wireframes
Website Development & Hosting
Web design and full hosting & maintenance packages!
Icon showing an envelope being opened
Modern Email Management
Microsoft 365 email provisioning, security & management.
“You’re giving me the ‘it’s not you, it’s me’ routine? I invented ‘it’s not you, it’s me.’ Nobody tells me it’s them not me; if it’s anybody, it’s me.”
- George Costanza
Learning CenterContact Us
Book A Consultation
Illustration of a person writing a blog post with a pencil

Record Locking Problems?

Over the last few years I've run into many customers with record locking issues.  Given the scenario of a shared multi-user database with the backend stored in SQL or another Access database, you risk two users simultaneously editing the same record.  You may have a form which presents a list of data, or a form with several bound data fields that users frequently edit.  So what happens when one user opens it and starts to modify the data, and then the other user also opens the same record?  The last user to write their changes wins.  So theoretically data could be lost (and frequently is!).

In SQL there are settings you can make to handle this better, but they are not always appropriate or more efficient (read about pessimistic vs optimistic locking).  However - there is another way:

Build a table to store user record editing
Upon edit of a record, write appropriate data to the table
After cancel or update, remove the record lock data
Plan for administration of the lock table in the event of network connection loss other unexpected happenings.

I wrote this code finally this week....integrated it into a Access front end on a SQL backend with more than 50 users.  It took some debugging to handle it properly, but we now have success!  It automatically displays a message when a user is editing a record if someone else also tries to simultaneously edit that record.  It then removes the message and lets you edit immediately upon the lock being removed, along with correctly showing the current data after other users modification.  NO messages to click, and no slow code.  No more lost data!

If you want a copy of this code, contact us and request it, I'll send you a copy for free!

Jeff Shirley
Article Written by Jeff Shirley
Related Articles
Featured image
Your Guide to Managed Website Hosting
Creating a website is only the first step. Keeping it online and accessible to visitors 24/7 involves a lot of additional work. Hosting your site means choosing...
2022 - Copyright, All Rights Reserved
crossmenu