Subject Re: [IBO] incremental search without fetching too many rows
Author TeamIBO
> Hi, I've to provide the user the possibility of starting write the
> name of the customers and having the matching rows displayed in a
> grid for selection.

This sounds a lot like TIB_LookupCombo :-) Perhaps you could just set
AutoDropDown to true to achieve the desired effect?


> Now it's working with a IB_Query and a IB_IncSearch. The problem is
> that this way I have to open the IB_Query that has a select like
> "select * from customers" and only after the user is entering some
> values in the IB_IncSearch there is a refinement in the dataset.

I am not sure you can get exactly what you are looking for this way,
since I dont think IB_IncSearch is not hooked up to work exactly as
you want.

One option that comes to mind is the use of the ParamName feature of
TIB_Edit (although this wont automatically follow the dataset
ordering like IncSearch). A quick experiement that I just did...

SELECT * FROM EMPLOYEE
WHERE LAST_NAME STARTING WITH :LAST_NAME_INPUT

Setup TIB_Edit with no DataField assigned, instead assign ParamName to
LAST_NAME_INPUT. Now your grid will show nothing until a parameter
value is entered.

Enter a value 'Be' into the edit control and tab out of the control
and the grid will show two records. For the moment, to get things
working smoothly, you will probably want to attach code to the control
so that:

procedure TForm1.IB_Edit1KeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
// on return force the parameter to be updated
if Key = VK_RETURN then
IB_Query1.UpdateData;
end;

Eventually I want to make this capability more automatic (since I need
it for some of my own apps).

Does this do what you want?

--
Geoff Worboys - TeamIBO
Telesis Computing