Solved

locking error

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

679 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