Solved

VB/ADO Record locking Help

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Validating VB6 Function 19 59
Access query that references subform 5 47
Getting warning: You are about to delete 1 row(s) 9 49
VBA Shell can't Find Word document 11 94
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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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 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…

809 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