Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to make an updatable view in a one-to-many relations
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00019391
Message ID:
00019629
Views:
43
>>Hello guys,
>>I have a one-to-many form, and the grid in my form is
>>populated with a view that has fields from 3 differents
>>tables, when I update one of the fields in my grid I receive the message "Warning KeyField is not unique
>>in table child_table_name", and then it replaces all the children records with the new value, how can I tell Foxpro to update just the child record that I'm updating?. The KeyField can't be unique because this is a 1-to-many relationship, is it possible to do what I want?
>>
>>Thanks in advance.
>
>Hola Luis,
>
>AFAIK, having a unique key for each record in your child table is needed, for identifying wich record will be updated. So u will have to use a composed key, with the foreing key + another field that uniquely identify each child's record.
>
>HTH,
>
>J. LUis

Hey Luis,
Guess what?, I found that if you tell foxpro that you has two
KeyFields it will work also, first I try what you said, I created
an index in my child table and it worked fine, then playing
around I found that if you mark the two fields that compose
the "unique_id" instead of the "unique_id" itself it works
exactly the same, Fox takes the combination of the two fields
to find the record that needs to be updated !, and you don't
need another index tag.
Isn't it interesting?
Luis Guzman, MCP
"The only glory most of us have to hope for
is the glory of being normal." Katherine Fulleton Gerould
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform