Subject Re: Field not found
Author Gerard J.M.Houtenbos
At 11:04 AM 12/04/2005 +0200, you wrote:

> I use a TwwDBGrid with programmatically filled columns:
>with MyGrid.Selected do
> Clear;
> Add('DEBITOR' + #9 + '14' + #9 + 'Deb' + #9 + ');
> Add('ARTICLE' + #9 + '16' + #9 + 'Article' + #9 + 'T');
>I use a TwwSearchDialog with the same selected property.
>If I use the SearchDialog and search for a not existing value then an
>error shows up with "Column unknow DEBITOR".

Correctly, since your DEBITOR field is not a database column.

gh: Ok, but an existing value is no problem. How come ???

>The column DEBITOR is fetched with this TIBOquery:
> , IVR_DEB.AFK AS Debitor
> , IVR_ART.AFK AS Article

Debitor and Article are both derived fields. Search keys can't be
formed on derived fields, since they exist nowhere except in the

>I traced down the problem and figured out that it is concentrated on
>the properties KeyLinks and KeyRelation of the TIBOQuery in
>combination with the aliassed fields. If I remove the contents of
>KeyLinks and KeyRelation, all goes well. If I don't, and in my
>application I do need them, an error arises if I ask for a non
>existing value.
>Any ideas?

Yes. If you need these values to be part of the key, or to be
updatable, or to be referred to as search keys, they can't be derived
fields. Since you need all of these key fields in your KeyLinks, it
is not an option for you to alias them. If you want to display them
with a different caption, use the FieldsDisplayName property.

gh: The problem is that the fields in the join query has the same
name, So I need to distiguish them in the appointment of the
Selected-property. If I don't alias them myself, then the field-editor
does. I suppose renaming the fields in the database is the only



IB Objects - direct, complete, custom connectivity to Firebird or
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________ - your IBO community resource for Tech Info
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Links


Gerard J.M. Houtenbos
DoubleWood Software