Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    MaxLocksFile registry (XP/2002)

    I am experiencing the following error message when executing VBA code that goes through approximately 11,000 records"
    "File sharing lock count exceeded. Increase MaxLocksFile registry entry."

    I followed Microsoft's recommendation of changing the MaxLocksFile registry entry and have progressively changed it from a start of 9500 to 20500 with the same result and stopping at the same record each time. The strange thing is that when I put an "If/Then" test inside the loop that executes a message box, the error goes away. In other words:
    dim cnt as integer
    do while not rs.eof
    . . .
    cnt = cnt +1
    If cnt = 9690 then
    msgbox "made it to 9690"
    end if
    . . .
    Loop
    With the above code inside the loop it goes through all 11,000 records. Without this code it stops everytime at record 9493 with the above error message.

    Any ideas are greatly appreciated.

    TIA

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MaxLocksFile registry (XP/2002)

    From what I read in the newsgroups, cranking up the registry value should solve the problem, but it won't work on a Novell network because that has a built-in limit of 10,000 file locks.
    Does it work if you replace the MsgBox statement by DoEvents?

  3. #3
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: MaxLocksFile registry (XP/2002)

    Hans,

    Thanks for the response.
    Is there a maximum number for the registry value? What is the downside of upping it? FWIW, there was no change in in the number of records it was processing when registry was 9,500 vs. 20,500.

    RE: DoEvents
    Replacing the MsgBox reverts back to the error message.

    Thanks again for your ideas.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MaxLocksFile registry (XP/2002)

    Sorry, no further ideas.

  5. #5
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: MaxLocksFile registry (XP/2002)

    Hans,

    I found a post on a board that a fellow increased the it to 60000 on all his clients pc's and no longer gets the message. I tried that setting and it worked!

    If 60000 is not a problem, why does it initially default to only 9500?

    strange.

    Thanks again Hans!

  6. #6
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: MaxLocksFile registry (XP/2002)

    I think it has to do with how much memory is allocated for the locks. Often these settings are carry-overs from way back when we had machines with alot less memory.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •