Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Size is Sometimes a Problem
Colin Eastaugh 
     
9 days ago
While using recordsets, I came across the Run-time error '3052'. "File sharing lock count exceeded.  Increase MaxLocksPerFile registry entry."

The temporary solution is to include in the intermediate window of VBA editor

"DAO.DBEngine.SetOption dbmaxlocksperfile,15000"

Has Richard covered this problem in a video, and did he recommend a permanent charge to the MaxLocksPerFile registry?

Thank you in advance for your help.
Alex Lewis  @Reply  
       
9 days ago
Record Locking: 599cd.com/RecordLocking
Alex Lewis  @Reply  
       
9 days ago
Are there multiple users running your database at the same time, or are you the only one using it?
Alex Lewis  @Reply  
       
9 days ago
He doesn’t cover error 3502 specifically, but the video I mentioned above generally explains record locking.

He covers reading/writing registry keys using VBA in his VBA Editor Theme series.
Colin Eastaugh OP  @Reply  
     
9 days ago
Alex - thanks for replying.

To give some background, I was adding consecutive numbers to a table with 13k records, see below
--
'STEP FIVE - ADDING CONSECUTIVE NUMBERS TO tblMASTER
Private Sub MasterConsecutiveNoXs()
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset(SQL)
rs.MoveFirst
ZZ = 0
While Not rs.EOF
ZZ = ZZ + 1
rs.Edit
rs!RndNo = ZZ
rs.Update
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
Status "Determining total records = " & ZZ
End Sub
--
Having posted to the forums and then taken a deep breath, I have compared the above recordset to a recordset that is working okay.

I can see how the problem has come about.  

I defined ZZ as String when I should have defined it as Long.  Hey presto, the problem has gone around. I guess defining ZZ as String takes up many more records given rs!RndNo - see above - is a number.

Sorry, I should have done the comparison earlier.  Thanks again for replying.
Richard Rost  @Reply  
          
9 days ago
This is one of the reasons why I say it's important to have meaningful variable names, even if they're only short temporary variables like S for a string, L for a long. Those kinds of things. ZZ is completely meaningless; you got no idea what ZZ is, but if it was S or L, you'd have a better idea.
Colin Eastaugh OP  @Reply  
     
8 days ago
It's a fair cop.  I've certainly learned my lesson (until the next time).

Now onto another recordset.
Add a Reply Upload an Image
Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/17/2026 9:48:17 AM. PLT: 0s