Hi there,
I'm developing an VB6 app that uses SQL occasionally, and I have this question: I have a table that one if its fields increments with each update. Once the new value is updated (incremented), I "select" it to the VB6 app.
What we're afraid of is, what will happen if inbetween the "update" and "select", a different user will "select" it, and the two users will get the identical value. How should I go about locking this record for the duration of the two DB calls?
(In short, I need to do this:)
------------------------------------
update drafts set counter = counter + 1 where id =...
select counter from drafts where id =...
------------------------------------
I want to lock that record before the "update", and unlock it right after the "select"