Solved

VB/ADO Record locking Help

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Modifying Conditional Format from VBA code 3 59
Add and format columns in vb6 7 63
How to Add / Edit Windows Menu 4 67
Recommendation vb6 to vb.net or others 14 174
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 …
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…
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…

840 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