?
Solved

SetOption.MaxLocksPerFile =8000 help config registry settings

Posted on 1999-11-23
7
Medium Priority
?
1,859 Views
Last Modified: 2012-08-13
hey List,

I'm trying to use the dbengine.setoption "dbMaxLocksperFile",8000 to adjust the registry settings at runtime in acces 2000, however I cant get the code to work. Do I have to add the "dbMaxLocksPerFile" and "Threads" to the application properties? I get a variety of errors from "variable not defiend" to command not optional?? Ahhhhh

Phill
0
Comment
Question by:Phillip_Knapp
  • 3
  • 2
  • 2
7 Comments
 
LVL 59
ID: 2229043
Phill,

It should look like:

Sub SetOption()

  DBEngine.SetOption dbMaxLocksPerFile, 8000
 
End Sub
0
 

Author Comment

by:Phillip_Knapp
ID: 2233349
Hey JDettman,
thanks for the responce. I've tried the code below in a "on click" event procedure and I still get a "variable not defiend" error refering to the dbMaxLocksPerFile variable.

Private Sub Command10_Click()
DBEngine.setoption dbMaxLocksPerfFile, 8000
End Sub

I've also noticed that when I move to the next line of code the "SetOption" changes the cap's to "setoptions". (removing the capital S and O. Can I run this code from an "on click" procedure, or do I have to use it in a module only?

Phill
0
 
LVL 59

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 160 total points
ID: 2237667
Phillip,

  Should work fine in any module.  Your problem is most likly that you don't have a reference to DAO.  Open a module in design view, click tools/references.  Make sure your using a DAO lib (for A2000, it should be DAO 3.6).

JimD.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 

Author Comment

by:Phillip_Knapp
ID: 2237746
with Jdettman's help got this fixed, and moving foward in the application developement again!! thanks JD!
Phill
0
 

Expert Comment

by:hartjo1
ID: 9173571
It's great to knwo that if I have a question that it's been asekd, more inportantly, answered before!   THough this thread is nearly 4 years old, it looks as if the good Mr. Dettman is still active, so here it goes...

I used the above solution tor esolve a similar problem, btu have a question regarding the affects of increasing the MaxLocks parameter has.  My current db is about 150,000 records, so I assume that I would set dbMaxLocksPerfFile at around the total number of records.  But as I need for my application to be scalable, I actually enterd a value of 1000000 for dbMaxLocksPerfFile.  Granted, it's overkill, but I figure better safe than sorry.  The question is,  does this slow down processing?  If so, is there any way to set the dbMaxLocksPerfFile value as a dynamic funciton, like setting the actual value of dbMaxLocksPerfFile to correspond to a variable which, in turn, is set equal to the number of records in the db?  Just a though!


-JDH
0
 
LVL 59
ID: 9173806
<<The question is,  does this slow down processing?>>

  The answer is yes and no.  Certainly placing a 100,000 locks on a MDB will be slow, but if you mean setting for 100,000 locks and if you don't always use them, will that slow things down? No.  I think your mis-understanding the use of the setting (see below)

<<  If so, is there any way to set the dbMaxLocksPerfFile value as a dynamic funciton, like setting the actual value of dbMaxLocksPerfFile to correspond to a variable which, in turn, is set equal to the number of records in the db? >>

  Sure, but your missing the point of the setting.  The idea is that JET will issue no more then this number of locks.  If it hits that, it will breakup whatever it's doing into multiple transactions internally.  So there are two things to consider:

1. Do you do use transactions?  If so, then you certainly want the setting high enough so that JET will always complete in a single transaction (if it's not, you might find that you really can't roll back).  If not, then it really doesn't matter what it does internally (well for the most part anyway).

2. Does the system support that number of locks?  For example, under Novell, there are absolute limits on the number of locks that a single user can place.  You can't set MaxLocksPerFile higher then this no matter what.  Otherwise Novell will complain and Access will lock up.  This BTW is why the setting was created in the first place; to make sure that Access/JET doesn't consume more locks then what the server will allow.

Hope that makes it a bit clearer

 
0
 

Expert Comment

by:hartjo1
ID: 9174143
Sure does.  Thanks!
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question