Subject Re: [IBO] Re: Lookup field problem
Author Helen Borrie
At 09:16 AM 22/08/2005 +0000, you wrote:
> > *Which* components?
>TIBODatabase, TIBOTransaction (with AutoCommit on),

Here is probably part of your problem (and something I didn't realise until
now): that you can't set an explicit TIBOTransaction as the
DefaultTransaction for a TIBODatabase. So the first thing to do will be to
remove that TIBOTransaction and just go with the internal
DefaultTransaction that is embedded in the IBODatabase. That will ensure
that both the main query and the lookup query are in the same transaction.

>TIBOQuery (here
>are the DEPARTMENT_IDs of every employee and lookup field defined to
>the TIBOTable with DEPARTMENTS, resulting the name of the department)
>
>QUERY.DEP_ID
>TABLE.ID
>TABLE.NAME

I don't understand what you are describing here. What one needs to see is
the SQL statement that is using the lookup.


> > In what way have you defined the lookup field. On *which*
> > components(s)? Which properties?
>Sure, it's on query:
>
> object IBOQueryDEPARTMENTNAME: TStringField
> FieldKind = fkLookup
> FieldName = 'DEPARTMENT'
> LookupDataSet = IBOTable
> LookupKeyFields = 'ID'
> LookupResultField = 'NAME'
> KeyFields = 'ID_DEPARTMENT'
> Lookup = True
> end
>
> > Have you heard of the expression "looking for a needle in a
>haystack"?
>Yeah i heard, i'm not a silly little boy. Just hoped my question is
>frequently asked, newbie one as the most of the question asked here.

The point I wanted to make is that you are making it impossible to
help. From the information so far, it isn't even possible to simulate your
conditions, to try to work out what is wrong.

And, no, in IBO, not, it's not frequently asked. This style of "lookup"
mechanism was designed for single-user desktop databases and table
components, not for client/server and networks and tight, efficient
retrieval. Most Firebird/IB people want to escape from such
inefficiencies. I think about the last time I used a Tlookupfield was in
Delphi 2 or 3.

I'm curious as to whether this thread has a serious purpose.

Helen