Solved

locking error

Posted on 2003-12-05
3
278 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

746 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

17 Experts available now in Live!

Get 1:1 Help Now