Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange Update View Results
Message
 
À
06/01/2005 13:46:42
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00974709
Message ID:
00974778
Vues:
16
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform