Record Locking in SQL
Posted on 2005-04-19
I SELECT a record from my SQL database, display it on my VB form, edit the data and finally UPDATE the record back to the SQL database.
My problem is that whilst editing the data, anyone else could load that record and start to edit it. I need to lock the record so that no one else would be able to load into the edit form.
I have looked at SQL, but the locking seems only to apply to a single transaction. I can lock the record whilst SELECTING or UPDATING, but as soon as that is completed the record is unlocked. I cannot keep it locked for twenty minutes whilst I edit the data. (or am I mistaken).
Is there a built in method of record locking, or do I need to design my own Lock table mechanism?