DBEngine.SetOption method (DAO) temporarily overrides certain internal settings of Microsoft Access database engine – until the instance of MS Access is closed. Its typical use is increasing of dbMaxLocksPerFile value:
DAO.DBEngine.SetOption dbMaxLocksPerFile, 15000
Is there a way to read the value set using SetOption
? (15000
from the example above)
I found that:
GetOption()
counterpart is not offered.Properties
collection does not contain entry for dbMaxLocksPerFile setting.This value is not readable by any known means.
What is the closest is to track all changes to this value manually. Then we know the last value we set (or initially, we use the DAO Engine startup value, which can be read from the Registry).
Implementation:
On startup, read and remember the value from the Registry (DAO Engine does the same, from Registry location which is commonly found documented) and during the runtime, just encapsulate the call of SetOption()
to procedure/method SetOption_Locks(newValue)
which takes note of a new value after making call to original SetOption()
. Create new method GetOption_Locks()
which returns the value learned before.