Solved

VB/ADO Record locking Help

Posted on 1999-01-20
2
322 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
[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
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…
Suggested Courses
Course of the Month9 days, 21 hours left to enroll

623 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