Solved

use of adLockPessimistic

Posted on 2004-04-06
7
648 Views
Last Modified: 2011-09-20
Hi,

I am getting the following problem .

Maximum locks exceeded per file.Increase the Locks per file.

I am trying with the following code.

Set rstemp = New ADODB.Recordset
rstemp.Open sCond, adoConAccess, adOpenStatic, adLockPessimistic

is there any effect of using adlockpessimistic ?
Any disadvantages of using   adlockpessimistic instead of adlockoptimistic


Pls let me know ..

Thanks,
Siva.
0
Comment
Question by:sivavb
[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
7 Comments
 
LVL 15

Expert Comment

by:unknown_routine
ID: 10768416
I  had the same problem but reading following link helped me to fix it.


Basically you need to avoid using adLockPessimistic, but if you have to updare the records as soon as possible.

Look here: It is a golden link.

http://www.vbmysql.com/articles/cursorsandlocks.html

it talked about mysql database , but these concepts are exactly same for SQL sever and MS access.

0
 
LVL 29

Expert Comment

by:leonstryker
ID: 10768427
The message has nothing to do with the type of lock you are using. adLockPessimistic and others specify as to how the database records are locked once the data is accessed.  Your problem seems to be with a number of locks.

Leon
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 10768440
Are you using an Access database? Is the file stored on a Novell file server?
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 4

Accepted Solution

by:
SSSoftware earned 25 total points
ID: 10768464
Lock Pessamastic - Locks the record when it is read for update
Lock Optamistic - locks the record when it is updated

If there is only one user of the database then Optomistic is OK
If there is more than one user then you have to be able to handle the situation that :

1 ) the record may be locked by a second user when tou go to update it.
2) the record may have changed between the time you read the record and you are now rewriting it.

additionally,

Depending on the database
    - If you are using commitment control then all records that have been read remain locked until a "Commmit" or a "Rollback" is issured.

Good luck,
Ed
0
 

Author Comment

by:sivavb
ID: 10768518
Hi Leon,

Thanks for the info..
U are right ..the prob is with the no.of locks..
Can u let me know what is the solution for this..

Thanks,
Siva
0
 
LVL 15

Expert Comment

by:unknown_routine
ID: 10768595


It seems to be a known issue identified by microsoft.


Here is how to fix the problem:

http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B815281



0
 
LVL 29

Expert Comment

by:leonstryker
ID: 10768613
Looks like unknown_routine got what you need. Give it a try :)

Leon
0

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…
Suggested Courses
Course of the Month9 days, 5 hours left to enroll

615 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