ADO does this for you.
Select your data using an ado recordset with the cursor options set to pessimistic locking on a server-side cursor. Make your you do not disconnect or close your recordset while you are processing. Use the Update or UpdateBatch features of ADO to update the data in your recordset.