Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange Update View Results
Message
 
To
06/01/2005 13:46:42
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00974709
Message ID:
00974778
Views:
15
>Maybe I am confused as to what happens with tableupdate().
>
>I have two users logged on to the application. They are using forms that have the pview as dataenvironment(buffermaodoverride set to 5). They both add records to the pview using insert into code. They both run the tableupdate() code. Please explain how the records added by the second user override the records put in by the first user.
>

The data resides on a server that all users can see. The first user opens a view that retrieves a set of data and that user makes changes to the data that no one else sees.

In the meantime, a second user opens the same view and retrieves the same data that the first user originally got. This user makes changes to the data that's different from the first user.

User 1 now saves the data to the server. After that, User 2 saves data to the server, but since you told VFP to force changes, what User 2 has done overwrites what User 1 did.

The way to handle this situation is to send .F. for the second parameter, but to check what the return value is from the TABLEUPDATE() function. If it returns .F., then you know there's a conflict of some kind, and you have to decide how to handle this. If you pass an array as the fourth parameter to the TABLEUPDATE() function, it will populate this array with the problems it finds. You should read the TABLEUPDATE topic in the help file.

You can also use CURVAL and OLDVAL to find out what is currently in each file on the server compared to what you started out with before the other user saved their changes.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform