Solved

use of adLockPessimistic

Posted on 2004-04-06
7
642 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

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 …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 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…

773 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