Results 1 to 4 of 4

Thread: Locking records

  1. #1

    Thread Starter
    Hyperactive Member parkes's Avatar
    Join Date
    Jan 1999
    Location
    Unitied Kingdom
    Posts
    303

    Post

    I'm using VB6 and Access 97 with ADO

    I've got a multi user application and I've got a button marked [Edit]. I want to put some kind of trap there so that they cannot edit this record if it is already open, but having no luck, can anyone point me in the right direction.

    I've opened the table using Pessimistic Mode

    ------------------
    Thanks in advance for any help provided.

  2. #2
    Addicted Member
    Join Date
    Apr 1999
    Location
    Freeport
    Posts
    204

    Post

    Use Lockedit

    ------------------

  3. #3

    Thread Starter
    Hyperactive Member parkes's Avatar
    Join Date
    Jan 1999
    Location
    Unitied Kingdom
    Posts
    303

    Post

    Cannot use Lockedit with ADO I'm afraid.

    ------------------
    Thanks in advance for any help provided.

  4. #4
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    This is from MSDN:

    Using Recordset Locking
    You use exclusive mode to lock an entire database. You use recordset locking, on the other hand, to specify locking for an entire table in a shared database. You can specify a read lock to prevent other users from reading records in the table, a write lock to prevent other users from editing records in the table, or both. ADO and OLE DB don't currently support this kind of locking, so you must use DAO code if you require recordset locking. Recordset locking applies only to DAO table- and dynaset-type Recordset objects; it can't be used with DAO snapshot-type or forward-only type Recordset objects, because these are inherently read-only objects. To implement recordset locking, Microsoft Jet places shared table-read and shared table-write locks.

    After you open the database in shared mode, you can implement recordset locking by specifying either of the dbDenyRead and dbDenyWrite constants in the Options argument of the DAO OpenRecordset method. You can also combine both constants by using the plus (+) operator if you want to apply both read and write locks to the table.

    I'm afraid you stock with DAO.


    Regards,

    ------------------

    Serge

    Software Developer
    Serge_Dymkov@vertexinc.com
    Access8484@aol.com
    ICQ#: 51055819



    [This message has been edited by Serge (edited 11-11-1999).]

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