Solved

use of adLockPessimistic

Posted on 2004-04-06
7
638 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
Comment Utility
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
Comment Utility
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 69

Expert Comment

by:Éric Moreau
Comment Utility
Are you using an Access database? Is the file stored on a Novell file server?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 4

Accepted Solution

by:
SSSoftware earned 25 total points
Comment Utility
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
Comment Utility
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
Comment Utility


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
Comment Utility
Looks like unknown_routine got what you need. Give it a try :)

Leon
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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.
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 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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now