Results 1 to 5 of 5

Thread: [RESOLVED] Record locking

Threaded View

  1. #1

    Thread Starter
    Frenzied Member TheBionicOrange's Avatar
    Join Date
    Apr 2001
    Location
    Cardiff, UK
    Posts
    1,818

    Resolved [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.
    Last edited by Hack; Apr 23rd, 2007 at 10:40 AM. Reason: Added RESOLVED to thread title Last edited by TheBionicOrange : Today at 10:54 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width