ADO locking a record w/o changing a field

  • I am using ADO in C++. I want the optimistic lock to go into effect when I populate the form, not when the data is first changed. Is there a way to force a lock? I know that I could have a dummy column and write to it to start the lock, but that seems a kludge.

    I am trying to avoid, user 1 opens form, user 2 does an open form/change/save, user 1 does a change (initiating the lock) and then updates overwriting the change made by user 2.

    This is my first post here, I did search for this info and failed, be gentle.

    Z

  • In SQL books online under locking hints.  You add a with statement and the locking you wish to be applied.  Following is a quick example.

     

    SELECT au_lname FROM authors WITH (NOLOCK)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply