[RESOLVED] Record locking
Morning all.
Quick question ....
When updating or adding records into a table via VB, if I were to use
Code:
Sql = "update TABLEA set B = B + 1 where C = '1234'"
connUpdate.Execute Sql
rather than
Code:
Sql = "update TABLEA set B = B + 1 where C = '1234'"
Set rsUpdate = New ADODB.Recordset
cmdUpdate.CommandText = Sql: cmdUpdate.ActiveConnection = connUpdate
rsUpdate.Open cmdUpdate, , adOpenDynamic, adLockPessimistic
Set rsUpdate = Nothing
what are the benefits and/or pitfalls ?
I realise that not defining a recordset for updates is neater, as its one less object to have to deal with, but how is locking handled in the first example ?
Is it just determined by the server ?
Apologies if all this sounds obvious, but I just don't know.