Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / September 2006

Tip: Looking for answers? Try searching our database.

File Sharing Lock COunt Exceeded Issue

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jeff - 28 Sep 2006 02:49 GMT
gday all

Scenario:
Access v11 SP2 (Office 2003)
2 Access tables in application database (not linked)
Table1 has approx 450,000 records and Table2 has approx 310,000 records
2 subs each the same but processing the 2 tables.
The first one works AOK, the second returns the error:
   Error# 3052 was generated by DAO.Recordset
   File sharing lock count exceeded. Increase MaxLocksPerFile registry
entry.

Code snippets:
-   This one works perfectly all the way through the 450,000 records.
Public Sub subWireSequencing()
Dim ldbsCurrent As Database
Dim lrstSource As Recordset
Dim strSQL As String, lstrCurrentCable As String
Dim intNewWireSequence As Integer
   Set ldbsCurrent = CurrentDb()
   strSQL = "SELECT * FROM CableSetWires " & _
            "ORDER BY CABLEID, WIRESEQUENCE, SEQUENCE;"
   Set lrstSource = ldbsCurrent.OpenRecordset(strSQL, dbOpenDynaset)
   lrstSource.MoveFirst
   lstrCurrentCable = ""
   intNewWireSequence = 0
   ' process each record
   Do While Not lrstSource.EOF
       ' if start of a new cable record then reset the sequencing
       If lstrCurrentCable <> lrstSource.Fields("CABLEID").Value Then
           lstrCurrentCable = lrstSource.Fields("CABLEID").Value
           intNewWireSequence = 0
       End If
       ' increment the current wire sequence
       intNewWireSequence = intNewWireSequence + 1
       ' update the wire sequence with the new sequence number
       lrstSource.Edit
          lrstSource.Fields("WIRESEQUENCE").Value = intNewWireSequence
       lrstSource.Update
       lrstSource.MoveNext
   Loop
   lrstSource.Close

- This one fails at around ~9500 records
Public Sub subWireSetSequencing()
Dim ldbsCurrent As Database
Dim lrstSource As Recordset
Dim strSQL As String, lstrCurrentCable As String
Dim intNewSetSequence As Integer
   Set ldbsCurrent = CurrentDb()
   strSQL = "SELECT * FROM CableSets " & _
            "ORDER BY CABLEID, SEQUENCE, SETSEQUENCE;"
   Set lrstSource = ldbsCurrent.OpenRecordset(strSQL, dbOpenDynaset)
   lrstSource.MoveFirst
   lstrCurrentCable = ""
   intNewSetSequence = 0
   ' process each record
   Do While Not lrstSource.EOF
       ' if start of a new cable record then reset the sequencing
       If lstrCurrentCable <> lrstSource.Fields("CABLEID").Value Then
           lstrCurrentCable = lrstSource.Fields("CABLEID").Value
           intNewSetSequence = 0
       End If
       ' increment the current Set sequence
       intNewSetSequence = intNewSetSequence + 1
       ' update the Set sequence with the new sequence number
       lrstSource.Edit
          lrstSource.Fields("SETSEQUENCE").Value = intNewSetSequence
       lrstSource.Update
       lrstSource.MoveNext
   Loop
   lrstSource.Close

As can be seen....almost identical code...different tables...it has got be
munted! Can anyone help????

cheers
Jeff
Tom Wickerath - 28 Sep 2006 09:34 GMT
Hi Jeff,

I have no explaination for why your first procedure works on 450,000
records, while your second procedure chokes at approx. 9500 records, other
than you are apparently exceeding the MaxLocksPerFile setting for whatever
reason. Try one of the resolutions shown in this KB article:

    "File sharing lock count exceeded…” error message during
     large transaction processing
    http://support.microsoft.com/?id=815281

What type of objects are CableSets and CableSetWires, ie. table or query?  
If CableSets is a query, one possibility is that the Record Locks property
for this query is set to All Records, but the same property is set to Edited
Record for CableSetWires.

Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________

> gday all
>
[quoted text clipped - 74 lines]
> cheers
> Jeff
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.