S.L. said:
I use DAO 3.6. For OpenRecordSet method, Compare dbReadOnly and dbDenyWrite,
what is different , what is stronger ?
dbDenyWrite prevents other users from writing to the base
dataset. While you have the recordset open, other users can
read the data, but they can not change it.
Now you've got me wondering too. I always thought that
dbReadOnly prevented you from modifying the data in the
recordset, but the description in Help might possibly imply
that other users can not modify it either.
I've used dbDenyWrite to lock the dataset while I manipulate
it in one procedure. If there is some other procedure that
only needs to check some values in the dataset, then it can
use dbReadOnly so it can proceed even if another instance of
the app is using dbDenyWrite to modify the dataset.
OTOH, dbDenyRead can be used when you want to prevent all
other access to the dataset. This is critical when you have
a one record table to keep track of your own "autonumber"
kind of calculated fields.