Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Have someone update my record before of me ?
Message
From
02/09/1998 11:53:00
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00132381
Message ID:
00132405
Views:
21
>>>hi to all,
>>>
>>>how can I check update conflit on a client/server app ?
>>>
>>>to explain:
>>>- for update conflit I mean when the users A and B load the same record, does some modifies, then A save modifies, now if B save there is a update conflit
>>>- in a normal VFP app, before to do the TableUpdate() I check the update conflit testing OLDVAL(myfield, mytable) and CURVAL(myfield, mytable), how can I do this on a C/S app ? I don't want to lock a record when I load it.
>>>
>>>TIA
>>>Renato
>>
>>Look at 'SQL Where' selection on 'Upadate Criteria' page of View Designer. This is exactly what will be checked automatically when you TABLEUPDATE() remote view.
>
>Sorry I've missed another information.
>To update my table in C/S app I don't use the TableUpdate() for the view, but I use the pass-through method so I do a SQLExec() with a "UPDATE .... WHERE ..." command. I don't know why I haven't use the tableupdate() of views, maybe to minimize the information to trasmit on the Wan, maybe can you say me the good and bad thing of the pass-through and tableupdate view methods ?
>
>TIA
>Renato

This case you should pass timestamp (converted to string) back and forth for each record, i.e. when you select a record in stored procedure:

Select 'string'=convert(char(3),convert(int,substring(Table.Timestamp,1,1)))+
convert(char(3),convert(int,substring(Table.Timestamp,2,1)))+
convert(char(3),convert(int,substring(Table.Timestamp,3,1)))+
....
convert(char(3),convert(int,substring(Table.Timestamp,8,1)))

and when you return this record to stored procedure:

Select @_Timestamp=convert(binary(1),convert(int,substring(@_string,1,3)))+
convert(binary(1),convert(int,substring(@_string,4,3)))+
convert(binary(1),convert(int,substring(@_string,7,3)))+
...
convert(binary(1),convert(int,substring(@_string,22,3)))

If @_Timestamp#@_TimestampNew
....
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform