CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2003
    Location
    Sri Lanka
    Posts
    64

    Record locking

    Hi

    I nned to know about record locking

    I opened a connection with
    adUseServer
    and I opened a recordset with
    adOpenDynamic and
    adLockPessimistic

    When another user try to open same record set, How do we check the record lock status

    Thnk u in advance

    Dinesh

  2. #2
    Join Date
    Sep 2003
    Location
    Sri Lanka
    Posts
    64

    Record Lock Help ?

    I use adLockPessimistic to open a record set.

    How do I know weather the selected record is locked by another person.

    If any body can show me an link to learn Multiuser programming with SQL server and VB 6.


    Thank you.

    Dinesh
    Last edited by dineshns; May 13th, 2004 at 10:26 AM.

  3. #3
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726
    these could help:

    http://www.sas-software.nl/devcon/AdoAdvanced.pdf

    http://www.vbmysql.com/articles/cursorsandlocks.html
    (from second link)
    In a situation of high concurrency, with multiple users modifying
    the same data, you may need a pessimistic lock type.
    With asLockPessimistic, the underlying rows (or table) will be
    locked as soon as you begin making changes to the current
    record, and will not be unlocked until the Update method is
    called.
    Thus, another process trying to update same record will fail.
    Trap error.
    Last edited by Cimperiali; May 14th, 2004 at 04:32 AM.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  4. #4
    Join Date
    Sep 2003
    Location
    Sri Lanka
    Posts
    64

    Thanks, and another Help

    Thank u for Help

    ex.. Sombody (Another User) has Open a recordset with LockPessimistic.

    My Problem is, When I am going to open the same record, It gives "Time out error" After 25-30 seconds. Aplication Freeses for 30 seconds.

    Is there any way to Check the recordset weather Is it locked or not before openning?

    Thank u.

    Bye

  5. #5
    Join Date
    Sep 2003
    Location
    Sri Lanka
    Posts
    64

    Please Help me?

    Thank u for Help

    ex.. Sombody (Another User) has Open a recordset with LockPessimistic.

    My Problem is, When I am going to open the same record, It gives "Time out error" After 25-30 seconds. Aplication Freeses for 30 seconds.

    Is there any way to Check the recordset weather Is it locked or not before openning?

    Thank u.

    Bye

  6. #6
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726
    There should be a sys table where all locked objects are listed...
    try searching help for sysObj on your Db...
    Last edited by Cimperiali; May 19th, 2004 at 10:42 AM.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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

Featured