Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB/ADO Record locking Help

Posted on 1999-01-20
2
Medium Priority
?
338 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 40 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

963 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