Solved

locking error

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…

734 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