|
-
Jul 31st, 2000, 01:37 PM
#1
Thread Starter
Hyperactive Member
I'm using VB6/ADO 2.1/Win9x/WinNT in a client/server environment. How can I know when the record I'm attempting to update is locked or is updating from another user.
-
Jul 31st, 2000, 09:12 PM
#2
Guru
I don't think there is any straight-forward way of determining this, you might have to trap an error when you edit (for pessimistic locking) or when you update (for optimistic locking)
-
Aug 1st, 2000, 02:58 AM
#3
Fanatic Member
Tonatiuh
You can use the EditMode Property in ADO to see what state the record is in
EDITMODE PROPERTY
Indicates the editing status of the current record.
Return Value
Returns one of the following EditModeEnum values.
Constant Description
adEditNone Indicates that no editing operation is in progress.
adEditInProgress Indicates that data in the current record has been modified but not yet saved.
adEditAdd Indicates that the AddNew method has been invoked, and the current record in the copy buffer is a new record that hasn't been saved in the database.
adEditDelete Indicates that the current record has been deleted.
Hope this helps
Gary Lowe 
VB6 (Enterprise) SP5
ADO 2.6
SQL Server 7 SP3
OK I know my spelling and grammer is crap so don't quote me on it!
To err is human to take the P! is only natural !!
Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip

-
Aug 1st, 2000, 08:20 AM
#4
Thread Starter
Hyperactive Member
Clunietp,
What error is the one I need to trap?
Thanks to Love.Lowe too.
-
Aug 1st, 2000, 11:29 PM
#5
Guru
Tonatiuh -- I'm not sure, you'll have to test for it
Gary -- does that work in a multi user situation? I assumed it was just for the local user...
-
Aug 2nd, 2000, 03:08 AM
#6
Fanatic Member
Clunietp
I assume it works in a multi user env as I am working on a project at the moment in a multi user env.
I have used this locking method and it seems to work.
I will double check though and reply once I've sussed it out.
Gary Lowe 
VB6 (Enterprise) SP5
ADO 2.6
SQL Server 7 SP3
OK I know my spelling and grammer is crap so don't quote me on it!
To err is human to take the P! is only natural !!
Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|