Method 2: Using SetOption to change MaxLocksPerFile Temporarily
NOTE: The sample code in this article uses Microsoft Data Access Objects. For this code to run properly, you must reference the Microsoft DAO 3.6 Object Library. To do so, click References on the Tools menu in the Visual Basic Editor, and make sure that the Microsoft DAO 3.6 Object Library check box is selected.
Note Changes made to the MaxLocksPerFile setting by using the SetOption method will only be available through the current session of Data Access Objects (DAO). Queries that are run through the Microsoft Access user interface will still use the settings in the registry.
The following code sample sets MaxLocksPerFile to 200,000 before executing an update operation inside a transaction:
Partager