Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem when changing RelationalExpr for Parent-Child Gr
Message
De
11/07/2002 05:48:55
 
 
À
11/07/2002 01:40:52
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00675542
Message ID:
00677438
Vues:
22
>>>>I have a Grid, configured for Parent-Child, which displays data from the Child file in a specific order. It works fine and as I move to some other record in Parent table, the Grid refreshes accordingly.
>>>>
>>>>When I move to some other record in Parent table, in some case, I want to display the Child records in some different order. So I change the ChildOrder and RelationalExpr properties of the Grid. As soon as I refresh the Grid, it displays no child records. I tried resetting the LinkMaster property also and also resetting the RecordSource of the grid by
>>>>
>>>>Thisform.ChildGrid.RecordSource = Thisform.ChildGrid.RecordSource
>>>>
>>>>method to prevent recreating the grid agin.
>>>>
>>>>What is wrong here? Is there any fixed order in which the RelationalExpr, ChildOrder and LinkMaster properties must be changed?
>>>>Any suggestions will be highly welcome.
>>>
>>>Problem is not the order of them, old realtion is alive. Setting relationalExpr doesn't automatically set it.
>>>
>>>.Recordsource = ''
>>>select parent
>>>set relation off into child
>>>.ChildOrder = 'NewOrder'
>>>.RelationalExpr = 'NewRelation'
>>>.Recordsource = 'child'
>>>
>>>Cetin
>>
>>Hi Cetin,
>>
>>Does the VFP use "set relation" internally to set the Parent-Child grid? Actually I wanted to avoid "set relation" in an existing piece of code and was trying this alternative. Seems I will have to abandon this method.
>>
>>BTW, can this work with partial key match? The child table index key has parent table's primary key field and some child table fields in the index expression. What will be the RelationalExpr in this case?
>>
>>Thanx for the info.
>>Hitendra
>
>Yes it sets relation internally (if not a relation is set).
>I don't understand why you want to avoid it.
>Yes it works with partial keys.
>Cetin

Hi Cetin,
We are facing problems with a Parent-Child implementation for Picklists using set relation. The child records here may have multi-level child records and the parent table stores the key values for the grand children also. Opening a grand-child means moving record pointer in Parent and setting / unsetting relations again. While executing "set relation to" sometimes, the application ends up with Fatal Exception Error.

MSDN article "FIX: C0000005 Fatal Error With SET('RELATION') Function ID: Q221737" seemed related and so we are looking out to eliminate "set relation" code and see if it helps. That's the reason why we want to avoid it. We are trying workaround by creating temporary tables containing child records for every change in Parent record. Just hoping that it works.

Thanx anyway.
Hitendra
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform