Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

use of adLockPessimistic

Posted on 2004-04-06
7
Medium Priority
?
655 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
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 4

Accepted Solution

by:
SSSoftware earned 75 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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

972 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