>I have a program that is being shared on the LAN. I have 2 users accessing the same form and record at the same time. User 1 makes modification to a table, the user 2 makes another modification to a table. My user 2 is an update conflict error 1585. The forms buffermode is set to Pessimistic and data sessions is private.
>Here is my code:
>
>r3 = tableupdate(.t., .t., 'vehicle')
>
>
>this works for updating for first user who gets to the form, but not for the second user. How do resolve this problem as far as letting the second user update, or even just check to see if there is a lock on record and display a message so that my application for the second user doesn't terminate after the standard error 1585 error message is displayed? Is there a way to unlock all records (I don't if this a good idea or not) after or prior to updates? Help much appreciated.
>
>Nick Patel
Hi Nick,
I would use Optimistic Table Buffering, then, assuming changes are made to a single record, in pseudocode do something like:
IF TABLEUPDATE( 0, .F., "Vehicle" )
ELSE
IF MESSAGEBOX( "Overwrite changes?", ... ) = MB_YES
ELSE
TABLEREVERT( .F., "Vehicle" )
ENDIF
ENDIF
You can use this general procedure and customize it as needed for your situation.
Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.