Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating a View Primary Key
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01089683
Message ID:
01090864
Views:
27
>>>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform