Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update conflict
Message
 
 
À
05/01/2001 03:28:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00459687
Message ID:
00459713
Vues:
18
Hi!

When you move record pointer, data from view automaticallu updated to base table. When you return back, view contains empty record that is already updated. So What? the problem is in the ID key. Views work using identifications of record in table. For new records ID key usually generated in the table. When record was updated, ID key in the table changed, but it still empty in the view. When you try to edit such record and than update, update conflict occurrs, just because record ID in view is different compare to the record ID in the table. After requery view (as you said, after close it and open again), new record contains valid ID field value, so now view ID and table ID are in synch - no conflict.

To fix this problem, you require to generate new ID key value in the view and save it immediately. In the view designer you can change properties of each field of view, include default value. You require also to save ID field to table (by default it is not saved), to do that check ID field to send it in update together with otehr fields in view designer.

HTH.

>I have a parameter updateable local view.
>
>The error appear when
>
>1.append a new record
>2.move the record pointer
>3.and then back the new record
>4.edit it...
>5.then system prompt me that update conflict.
>
>I need to close the view and open it again to edit the new appended record.
>
>Why... how to solve this... :(
>
>TIA.
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform