Page vs Recordset Locking

Page vs Recordset Locking

Post by David Barret » Fri, 26 Jun 1998 04:00:00

I have been wrestling with locking/concurrency problems in my
VB5/Access7 App now for weeks, and can't seem to make it make sense.
The manuals seem to indicate a difference between a 'page lock' (2k
pages) and a 'recordset lock' which locks the whole table, either for
dbDenyWrite or dbDenyRead or both.  I need recordset locking, as I want
my app to have exclusive write access to a particular table for a
particular length of time - sort of like 'critical section' behavior.  I
have been getting problems like:

    - can't open the database at all when someone has a dbDenyWrite
recordset open
on one of the tables, even though the recordset isn't being edited at
the time and so shouldn't be locked.
    - can't have the same table open as two dbDenyWrite recordsets at
the same time, same problem as above.
    - can't open a table as dbDenyWrite when a data control is linked to
it, even if that control is opened as read-only.
    - once a table has been opened as dbDenyWrite, this lock can't seem
to be cancelled by any method short of closing the VB app, closing the
recordset doesn't seem to make any difference.

If anyone has either some tips on these problems or the location of some
documentation on locking which is actually useful (ie not Microsoft)
could they please let me know?  Thanks very much.

-David Barrett