Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Key field not updating.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00761947
Message ID:
00763100
Vues:
26
Ken,

Ok, I gotta you... Well the only thing I can think of is VFP views by default will not set the primary key field as updatable. Are you sure the key is checked as updatable in the view designer? I know you said it use to work but that is the only thing I can think of. You could check by opening the view in the IDE and type the following:

? CURSORGETPROP("KeyFieldList")
? CURSORGETPROP("UpdatableFieldList")
? CURSORGETPROP("UpdateNameList")

Make sure the field is in each of these lists.

>>Ken,
>>
>>The default value of the underlying table will not be called if the Primary key field is
>>marked as updated in the view. It will simply write the value found in the view to the table. When using views the best way to handle primary keys is generating the ID when adding a record to the view.
>>
>
>
>HI Will,
>
>I kind of thought the wording on my message was not completely clear and that I might get this response. I'll try again:
>
>The field in the view that corresponds to the primary key field in the table has an default value function. The table itself does not have any default values. When I INSERT a new record to the view that field gets a new value from the default function. I then do a TABLEUPDATE on the view to write the changes to the table.
>
>Now I would assume that the table would simply get a new record with the field values from the view. And it does for all the fields except the key field.
>
>Weird thing is I have other views and tables that work this way and this particular view was working until a short time ago. I just can't figure out why it stopped working.
Heavy Metal Pedal - click with care
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform