Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

locking error

Posted on 2003-12-05
3
Medium Priority
?
287 Views
Last Modified: 2010-05-03
When I run the following action on an access database I get the following runtime error
"File sharing lock count exceeded"

There are  25000 records in the recordset.

Does anybody know what I can do about that

Set RsMain = New ADODB.Recordset

RsMain.Open "select * from test", CN, adOpenStatic, adLockoptimistic

RsMain.MoveFirst
Dim x As Integer
   
With RsMain
For x = 1 To RsMain.RecordCount
    !returns = Round((!a * 0.07) + (!b * 0.04) + (!c * 0.12), 4)
    !risk = Round(Sqr((((0.19) * !a) ^ 2) + ((0.19 * 0.09 * 0) * !b * !a * 2) + _
    ((0.19 * 0.11 * -1) * !a * !c * 2) + (((0.09) * !b) ^ 2) + _
    ((0.09 * 0.11 * 0) * !b * !c * 2) + (((0.11) * !c) ^ 2)), 4)
    .MoveNext
Next
End With

MsgBox "ok"
0
Comment
Question by:RonaldBiemans
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 500 total points
ID: 9881224
-you could have a look in your Registry at "MaxLocksPerFile"
-normaly this stands at 9.500 Records (at least that was with A97)
-up it a bit

-Location in the Registry was:
HKEY_LOCAL_MACHINE\Sotfware\Microsoft\Jet\3.5\engines\Jet 3.5\

"Jet/3.5/.........." could be something different on your machine

hope this helps a bit
0
 
LVL 25

Author Comment

by:RonaldBiemans
ID: 9881254
Thanks Bruintje,

But why doesn't it release the lock once it updated the record ?

RB
0
 
LVL 44

Expert Comment

by:bruintje
ID: 9881302
not sure but looks like the recordset has the records locked while being open if it's closed again the records are released
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question