Subject Re: [IBO] Topic: KeyDescLinks with CalculatedFields bug?
Author TeamIBO
> I don't see how this could be a bug since I tested this
> thoroughly... Please expound on this.

Following is what I tried to send privately...

- - - - - - -
procedure TIB_Dataset.KeyToChildAction( AAction: TIB_KeyChildAction;
Info: longint );
<...>
ADataset.Prepare;
//TIB_Row( Info ).Values[ tmpVals ] :=
// TIB_BDataset( ADataset ).Lookup(
// tmpKeyVals,
// TIB_Row( Info ).Values[ tmpKeyFlds ], tmpFlds );
TIB_Row( Info ).Values[ tmpVals ] :=
TIB_BDataset( ADataset ).Lookup(
tmpKeyFlds,
TIB_Row( Info ).Values[ tmpKeyVals ], tmpFlds );
<...>
end;

Where you do the .Lookup call above I think you have the tmpKeyVals
and tmpKeyFlds reversed (your code in the commented out, my
replacement code underneath).

That is; ADataset.Lookup is the LookupDataset and the tmpKeyFlds
are the key fields of the lookup dataset. TIB_Row(Info) is the Fields
row from the main dataset, and the matching fields there are given by
the tmpKeyVals string.
- - - - - - -


I suspect the reason why your tests work relate to what you said on
the previous thread about having link fields named the same. In such
situations the tmpKeyFlds and tmpKeyVals lists would be the same and
so it does not matter which way they were provided.
In situations using joined datasets or where the link fields are named
differently then there are differences and the original code shows the
reversal of the entries.


--
Geoff Worboys - TeamIBO
Telesis Computing