Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating Multiple Records with Multiple Users
Message
From
02/10/2001 09:27:21
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00562935
Message ID:
00562953
Views:
20
Hi!

Use tableupdate() with no "force" option. If tableupdate() in such case return .F., start to dig in details what was exactly changed: use refresh() command for that record in the view and then use compare OldVal()/CurVal() for fields in the record that were changed on the server and tried to be overwritten from the client side (use getfldstate() to see what fields were modified at client side and do comparison for these fields). Ask user if he want to overwrite changes in particular field or leave them on the serever. When leave on the serevr - assign CurVal() value to the field, when overwrite - leave it as is, then try to update again but with "force" option. You require also to have a timestamp field in that table (usually just a datetime) - in the moment between you scan fields and prompt user to confirm overwrite, record could be changed again. Before second tableupdate() with "force" option, check that timestamp for changes to see if there are no other changes. This require all places in application that update data in teh table to do update of the timestamp as well.

>Hello all,
>
>I need some assistance with update logic. Currently I have a VFP6 application connecting to an Oracle 8 database. All view are created through SPT and I then use CURSORSETPROP to make the views updatable.
>
>The problem that I am running into is that since this is a relational database multiple records in multiple tables must be updated at once. I am unable to force updates with TableUpdate due to business rules.
>
>So here is my question. Is there some way that I can check each of the tables to see if any user has made an update to the table since I grabbed my view without having to do a second select and do a field by field comparison? I know table update generates an error if this happens but if I update half of the tables and then encounter an error I cannot undo the updates that I just made.
>
>Any suggestions would be extremely welcome.
>Thank you
>Matt
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform