|
-
Apr 13th, 2000, 11:18 PM
#1
Thread Starter
Addicted Member
As is often the case there are several ways to Skin a cat in programming - what I would like to know is what is the best/preferred way of providing Multi-user VB prog with Access97 using ADO (because want to easily upgrade to SQL server if need to). I.e. if user edits record which another edited between them viewing and editing then handle it by asking which update to use ( "Original field value=200, other user set it to 230, you set it to 250 - which do you want?"). I think optimistic locking would be best.
Thanks in advance.
Regards,
John.
-
Apr 13th, 2000, 11:26 PM
#2
Guru
General rule of thumb: Use pessimistic locking if you expect contention for a relatively small number of records and you want to prevent other users editing the same record at the same time.
The performance is slower than optimistic locking, but sometimes you gotta do what you gotta do.....
-
Apr 14th, 2000, 12:03 AM
#3
Thread Starter
Addicted Member
Thanks - but....
Still, how do I take account of the position where someone else changed a value and when other goes to record they see old value - change it and inconsistency - this happens regardless of where optimistic or pessimistic.
Thanks.
-
Apr 16th, 2000, 12:27 AM
#4
Guru
If you are using a static or forward only cursor, I suppose you can use the Resync method before a user edits the record to make sure it has not changed
If you are using a keyset/dynamic cursor with pessimistic record locking, nobody but the person currently editing the record should be able to edit it....
-
Apr 16th, 2000, 03:04 PM
#5
Thread Starter
Addicted Member
I must be doing it wrong....
I hear what your saying but when the second user accesses the record after the first has done the editing they require the 2nd doesn't see the updates of the 1st. Ive looked at the properties of the ADO query/DED but there is no sign of a record change even in the underlyingvalue or originalvalue properties.
I'm doing something wrong!
-
Apr 16th, 2000, 11:47 PM
#6
Guru
What kind of cursor are you using? (dynamic, keyset, static or forward only?)
-
Apr 17th, 2000, 02:36 PM
#7
Thread Starter
Addicted Member
Keyset (read that Access wouldnt allow something important using Dynamic).
-
Apr 19th, 2000, 11:49 AM
#8
Guru
Got me. It should work, assuming you are issuing an edit and then an update command.....
anyone else?
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
|