Subject Re: [IBO] Keylinks
Author Helen Borrie
At 01:14 PM 04-04-01 +0000, you wrote:
>Hi all,
>
>I've an error with TIBOQuery.
>
>I use a simple TIBOQuery like 'SELECT Field1 FROM T1' to load a list
>of values. It works well.
>
>If I want to suppress the current record of the selection with a
>statement like this :
>
>'SELECT Field1 FROM T1 WHERE PK <> a_value',
>
>I get an error : "Invalid KeyLinks entry : T1.PK"
>
>If I modify the statement in order to have PK in selected fields, it
>works.
>
>An other solution is to set KeyLinksAutoDefine to false.
>
>But why ?


Keylinks is used to get a unique identification for a row in the dataset, so that it can be matched up to the row from which it was extracted in the database table, when updates or deletes are requested, or checked for nonexistence if an insert is requested.

If you are just using this query for selection purposes, then you don't need a live dataset and KeylinksAutoDefine false is OK.

Once you introduce a WHERE clause it usually becomes important for IBO's default handlers to know the origin of the rows in order for refresh to work under some conditions, e.g. where a lookup description is refreshed on scrolling. Autodefine false is OK if your application isn't linking any columns from other datasets to this one; otherwise, include the PK in the SELECT and just make it non-visible.

Cheers,
Helen


All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________