Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2008

    Unanswered: MAx locks per file registry

    Hi all!

    I got the run time error-3052 "File sharing lock count exceeded. Increase max locks per file registry".

    I am working on MS access 2007 and Windows Vista environment.

    I increased the "max locks per file" value in the registry. My Database is of 200 MB size and i raised the value to 500000. Even after increasing the value i got the same error.

    I am not getting the error while opening the application in access 2003 or 2000 environment.

    Help me at the earliest.


  2. #2
    Join Date
    Feb 2004
    Chicago, IL
    I get that message a lot when I am updating thousands of records at a time. Is this when you are getting it? Is there a way you can do the updates with SQL?

    Otherwise, here is some code that I have written to side step the error. I noticed that when I get the message, if I debug and then run the code (without making any changes) the code would continue unitl it finished or errored again. So it seems to be a timing problem (a number of edits are being done but not written). So the code I have catches the error pauses for a couple of seconds and then continues. Here it is:

        'If file lock exceeded error pause for a second then resume
        If Err.Number = 3052 Then
            Pause 1
            MsgBox "Error " & Err.Number & " - " & Err.Description, vbInformation + vbOKOnly, "Error Initializing"
        End If
    End Sub
    Here is the Pause routine:

    Public Sub Pause(sinSeconds As Single)
    'Description :      This procedure will 'pause' execution of the program for the specified number of
    '                   seconds
    'Parameters :       lngSeconds      Number of seconds to pause, can be a fraction.
    'Return :           None.
    ' 08/18/03  Original procedure.
    ' 03/13/06  Adjusted for midnight
        Dim sinStartTime As Single
        Dim sinFinishTime As Single
        Dim lngCount As Long
        'Get the current number of seconds since the beginning of the day
        sinStartTime = Timer
        sinFinishTime = sinStartTime + sinSeconds
        'Adjust for midnight
        If sinFinishTime > 86400 Then sinFinishTime = sinFinishTime - 86400
        Do Until Timer > sinFinishTime
            lngCount = 0
    End Sub

Posting Permissions

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