Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2002
    Location
    Island of Dots
    Posts
    316

    Unanswered: Test to see if a record is locked

    Is it possible to test (in VB) to see if a particular record is locked?

    My forms are based on queries that return a single record, but this seems to render Access's record locking redundant. To get around this, I'm hoping there is a way I can detect if a record is locked/already opened by a query.

    Any help much appreciated.

  2. #2
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    Arrow Try this

    GetLockingMode
    BOOL GetLockingMode( );
    throw( CDaoException, CMemoryException );

    Return Value

    Nonzero if the type of locking is pessimistic, otherwise 0 for optimistic record locking.

    Remarks

    Call this member function to determine the type of locking in effect for the recordset. When pessimistic locking is in effect, the data page containing the record you are editing is locked as soon as you call the Edit member function. The page is unlocked when you call the Update or Close member function or any of the Move or Find operations.

    When optimistic locking is in effect, the data page containing the record is locked only while the record is being updated with the Update member function.

    When working with ODBC data sources, the locking mode is always optimistic

Posting Permissions

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