Solved

locking error

Posted on 2003-12-05
3
281 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
  • 2
3 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 125 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

813 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now