Solved

VB/ADO Record locking Help

Posted on 1999-01-20
2
264 Views
Last Modified: 2013-12-25
i have a problem with VB6/ADO record locking. i'm trying to write a simple database program that is multiuser supported using vb6/ADO, so what i want is record editing deny from multiuser at the same time. consider my configuration is following
CursorLocation = adUseServer
CursorType     = adOpenDynamic
LockType       = adLockPessimistic
Mode           = adModeShareDenyWrite

then when first user is in (EditMode = adEditInProgress), then if the second user go and edit the same record, it will be error right ? but my program goes hang. when i during my testing, i run the first instance of program and stop in Editing mode(EditMode = adEditInProgress), then run the second instance program , when reach the Editing line then my second program goes hang. why ?  



First instance program
----------------------
RS("Field1") = "test1"       'executed this line and exit so that EditMode is go into adEditInProgress


second instance program
-----------------------
RS("Field1") = "test2"       'program goes hang once tried to execute this line


 
0
Comment
Question by:dumper
2 Comments
 
LVL 2

Accepted Solution

by:
cedricd earned 10 total points
ID: 1499243
using the adLockPessimistic , the record is locked on the update
try with adlockoptimistic
0
 

Author Comment

by:dumper
ID: 1499244
but i prefer to use adLockPessimictic because i dont allow second user to be enter into edit mode when the record is edited by another user.
0

Featured Post

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

Join & Write a Comment

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

760 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

21 Experts available now in Live!

Get 1:1 Help Now