Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating a View Primary Key
Message
 
 
À
26/01/2006 16:37:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01089683
Message ID:
01090864
Vues:
26
>>>what you are saying is that you are sending a tableupdate from the changed view but the pk field is not updating?
>>>
>>>I think the issue is probably the view setup, when you create a view in the view editor it defaults to updating all fields but the PK.
>>>
>>>in modify view > update criteria, check that the pencil is ticked next to your PK field, and also that the send sql updates box is ticked at the bottom.
>>>
>>>save that and it should now work.
>>>
>>>Hope thats what you need.
>>>
>>>Ken.
>>
>>Thanks Ken but the problem is that the View PK is not being updated. When I add a new record the PK is "0", after TableUpdate the Table is updated and a new PK is generated, for example 1110, but the View PK still remains "0" and I don´t want to requery the View only to update a single field of a single record.
>>I think that I´ll have to change my PK field to Integer and use the NewId() function.
>>
>>Regards,
>
>You could use REFRESH() function to refresh ionly the current record. I never used it so I can't asy what happens :o))

I second that. or create the primary key on your view side, and send it with the update. you'll need some code to ensure no other record had been added before you but that's how I do it and it works perfectly. I had to go this way as I'm still on vfp6 so the auto pk stuff doesn't exist for me.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform