Results 1 to 6 of 6

Thread: Locked...

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 1999
    Location
    Reynosa, Mexico
    Posts
    274
    I'm using VB6/ADO 2.1/Win9x/WinNT in a client/server environment. How can I know when the record I'm attempting to update is locked or is updating from another user.

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    I don't think there is any straight-forward way of determining this, you might have to trap an error when you edit (for pessimistic locking) or when you update (for optimistic locking)

  3. #3
    Fanatic Member Gary.Lowe's Avatar
    Join Date
    May 2000
    Location
    In my sphere of influence
    Posts
    621
    Tonatiuh

    You can use the EditMode Property in ADO to see what state the record is in

    EDITMODE PROPERTY

    Indicates the editing status of the current record.

    Return Value

    Returns one of the following EditModeEnum values.

    Constant Description
    adEditNone Indicates that no editing operation is in progress.
    adEditInProgress Indicates that data in the current record has been modified but not yet saved.
    adEditAdd Indicates that the AddNew method has been invoked, and the current record in the copy buffer is a new record that hasn't been saved in the database.
    adEditDelete Indicates that the current record has been deleted.

    Hope this helps
    Gary Lowe
    VB6 (Enterprise) SP5
    ADO 2.6
    SQL Server 7 SP3

    OK I know my spelling and grammer is crap so don't quote me on it!

    To err is human to take the P! is only natural !!

    Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip


  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    May 1999
    Location
    Reynosa, Mexico
    Posts
    274
    Clunietp,
    What error is the one I need to trap?

    Thanks to Love.Lowe too.


  5. #5
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    Tonatiuh -- I'm not sure, you'll have to test for it

    Gary -- does that work in a multi user situation? I assumed it was just for the local user...

  6. #6
    Fanatic Member Gary.Lowe's Avatar
    Join Date
    May 2000
    Location
    In my sphere of influence
    Posts
    621
    Clunietp

    I assume it works in a multi user env as I am working on a project at the moment in a multi user env.

    I have used this locking method and it seems to work.
    I will double check though and reply once I've sussed it out.
    Gary Lowe
    VB6 (Enterprise) SP5
    ADO 2.6
    SQL Server 7 SP3

    OK I know my spelling and grammer is crap so don't quote me on it!

    To err is human to take the P! is only natural !!

    Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip


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