Subject Re: [IBO] {IBO] Re: Field not found
Author Helen Borrie
At 03:10 PM 17/05/2005 +0200, you wrote:
>Helen,
>
>Can you look in to this problem again?

I don't know what else I could look at, sorry.

>Helen, I figured out that the control work with a Locate on tha
>dataset. That's why I made the following solution. I catch the action
>where the search take place and substitute it by the following code:
>
>
>procedure TForm.GridSearchDialogPerformCustomSearch(Sender: TObject;
> LookupTable: TDataSet; SearchField, SearchValue: String;
> PerformLookup: Boolean; var Found: Boolean);
>var
> lFound: Boolean;
>begin
> with TIBOQuery(LookupTable) do
> begin
> try
> lFound := Locate(SearchField, VarArrayOf([SearchValue])
> ,
> [loCaseInsensitive, loPartialKey]);
> except
> lFound := False;
> end;
> end;
> Found := lFound;
>end;
>
>In my opinion the problem thus is caused by the fact that the Locate
>implementation of TIBOQuery can't work with aliased fields. Am I
>correct? The people of Woll2Woll tested it with a normal TQuery and
>that's working fine.

Well, I can't see how it would work if rows needed refetching into the
buffer, since your derived fields are not to be found in the database. If
your workaround works for you, then stick with it.

Alternatively, if it's really important for you to have the Locate method
work only on an absolutely-buffered set and you don't care about
performance across the wire, you could emulate TQuery by using FetchAll...

Helen