Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    714

    RTE 3052, .update doesn't release a lock?

    Windows 11, Access 2021, Version 2407
    I was just testing a little progress "bar" for inside forms,
    and although I've updated hundreds of thousands of records with other code,


    it seems odd that this code fails.
    Just look at the two yellow highlighted lines (and the middle part) for the fundamentals of the code:

    Click image for larger version. 

Name:	240826Locks1.gif 
Views:	27 
Size:	46.2 KB 
ID:	52152

    But it fails with RTE 3052 a bit over 9,000 records processed (the exact count varies).
    I would have thought the ".update" would release the current record's lock. If I understand the error message correctly.
    I admit I'm a bit confused with the "File sharing lock" part of the error message, why not "Record sharing lock"? I'm only updating one table. No other code is running.

    Am I missing something here?
    Thanks

  2. #2
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    The default is 9500.

    You can raise it with

    DAO.DBEngine.SetOption dbmaxlocksperfile,15000
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  3. #3
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    714

    And what does that mean

    Quote Originally Posted by moke123 View Post
    The default is 9500.

    You can raise it with

    DAO.DBEngine.SetOption dbmaxlocksperfile,15000

    I'm not sure I understand exactly what we are increasing. It doesn't seem to be the locks for records that are open for editing.
    The MS help doesn't tell me much.

  4. #4
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    714
    More...

    The 3052 error occurs on the .Edit line, so one would think it has to do with locking the page.
    I tried RecordsetOptionEnum as 1 and 3 to no affect.
    Clicking on Debug, then pressing F5 allow the procedure to complete.
    If there was something more than a timing problem, I would think the execution wouldn't continue.

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,559
    Would be interesting to see sAddstatus as that could contribute to your issue as you are calling it all the time?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    ano is offline Competent Performer
    Windows 11 Office 365
    Join Date
    Nov 2023
    Posts
    204
    yeah how abt repair ur database or use a different laptop as tom van stiphout suggest

  7. #7
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  8. #8
    ano is offline Competent Performer
    Windows 11 Office 365
    Join Date
    Nov 2023
    Posts
    204
    i dont believe in file share lock count exceeded bec the number is low for a database, and it will consume lots of memory in a large database i guess that tom has the right answer, special bec mentioned was it was not reaching the number but went wrong earlier but not same number

  9. #9
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    714
    Quote Originally Posted by Welshgasman View Post
    Would be interesting to see sAddstatus as that could contribute to your issue as you are calling it all the time?
    I've commented out the line, no difference.
    There is only a dbOpenSnapshot in the called procedure, and it runs less than 200 times. It runs of thousands of times throughout the code in a session without this problem happening.
    Also, I've rebooted, and the first time the procedure runs, every time after that the RTE.

  10. #10
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    714
    Quote Originally Posted by ano View Post
    yeah how abt repair ur database or use a different laptop as tom van stiphout suggest
    It worked once after a repair, then it fails. The next repair didn't even allow it to run once, so maybe a fluke.
    I've tried on another laptop. Same problem.
    Also, I've updated to 2408, problem continues.

  11. #11
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    714
    I've read those, but they don't seem to answer what is going on. I can change it to 15000, but what happens at the next time when there´s 16,000 records?
    It makes no sense for thousands of "locks" being set when were just updating one record at a time.
    It talks about transactions, but I'm not doing that (i.e. .BeginTrans)

  12. #12
    ano is offline Competent Performer
    Windows 11 Office 365
    Join Date
    Nov 2023
    Posts
    204
    the fact repair did once shows there is no lproblem in flow only problem in dadatbase; try create new blank database and import only what u need

  13. #13
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    714
    Quote Originally Posted by ano View Post
    the fact repair did once shows there is no lproblem in flow only problem in dadatbase; try create new blank database and import only what u need
    I've tried in 2 databases, one was imported. Same problem.
    I'm guessing it is a cumulative problem, hence it runs fine once (with 10,000+ records), and not after.
    I imagine lots of people are running similar code to do minor changes to a table field, to more than 10,000 records.
    No one else is having this problem?
    Again, what is the error message trying to say when we are working on one record at a time without "transaction processing"?

  14. #14
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,559
    Have you tried just using a query?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  15. #15
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    714

    Sample database for testing

    Here, I did a simple database.
    Just run the only procedure in the module.
    Does it crash on other versions of Access?

    TestRte3052.zip
    Last edited by twgonder; 08-27-2024 at 12:34 PM.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Require VBA code update to "release resources"
    By skydivetom in forum Programming
    Replies: 2
    Last Post: 07-17-2024, 08:19 AM
  2. Replies: 5
    Last Post: 11-13-2017, 02:09 PM
  3. Replies: 2
    Last Post: 05-27-2015, 12:59 PM
  4. Update Query - Retry when lock violation
    By MarkGallie in forum Queries
    Replies: 6
    Last Post: 10-22-2013, 09:36 AM
  5. Replies: 1
    Last Post: 12-29-2011, 05:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums