I have a MS Access table which has a column called “recordLocked”. Think of it as an editor. The contents is stored in the table and I have two users who want to edit the same content.
The system I have automatically “gives” the content to users to edit. So They log in and I have a timer which will ask the server (at random intervals) for content to edit.
Technically, two users logged on should NEVER request content from the server at the same time… yet they do. To the second. If I view logs, they say
"11:03:06 user 12 asked for content"
"11:03:06 user 77 asked for content"
When user 12 asks for the content, the c# code will update the record in the database to “locked” – so technically when user 77 asks for the content, it shouldn’t give it to them (as it’s locked).
But as they are asking at the same time, it’s giving it to both of them.
Is there a better way to “lock” a record in this way? It’s a YES/NO field which I query.
Thanks for any info!
You will want to look at record locking, which will lock a record (row) whilst it is being accessed/edited.
You can find how to implement this here: http://www.databasedev.co.uk/multi-user-application-record-locking.html