VB/ADO Record locking Help

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

Who is Participating?
cedricdConnect With a Mentor Commented:
using the adLockPessimistic , the record is locked on the update
try with adlockoptimistic
dumperAuthor Commented:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.