Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
432 views
in Technique[技术] by (71.8m points)

ms access - GetOption() missing – How to fetch value of SetOption dbMaxLocksPerFile of DAO.DBEngine?

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.
question from:https://stackoverflow.com/questions/66059196/getoption-missing-how-to-fetch-value-of-setoption-dbmaxlocksperfile-of-dao-d

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...