Subject Re: [IBO] Problem with FindFirst - endless loop
Author Jason Wharton
I'll probably need a demo app to work with something like this.

Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


----- Original Message -----
From: "Kevin Stanton" <Kevin.Stanton@...>
To: "IBO List" <IBObjects@yahoogroups.com>
Sent: Wednesday, May 08, 2002 2:33 PM
Subject: [IBO] Problem with FindFirst - endless loop


> The following code puts IBO into a loop, refetching data (the "Fetching
> Query Results" window keeps restarting).
>
> Any ideas will are greatly appreciated.
>
> Win 2K
> IBO V4.2.Gb
> Borland IB 6.01
>
>
>
> procedure TfrmOEList.btnFindClick(Sender: TObject);
> var
> UserResp : TModalResult;
> Fld : String;
> begin
> frmOrderSearchOE := TfrmOrderSearchOE.Create(Application);
> UserResp := frmOrderSearchOE.ShowModal;
> SFld1 := frmOrderSearchOE.SearchFld1;
> SFld2 := frmOrderSearchOE.SearchFld2;
> SVal1 := frmOrderSearchOE.edtSearch1.Text;
> SVal2 := frmOrderSearchOE.edtSearch2.Text;
> frmOrderSearchOE.Release;
>
> If UserResp <> mrOK then Exit;
>
> with dmOEExp.qryOrderList do
> begin
> dmOEExp.qryOrderList.InvalidateSQL;
> dmOEExp.qryOrderList.Refresh;
>
> Filter := SFld1 + '=''' + SVal1 + '''';
>
> If SVal2 <> '' then
> Filter := Filter + ' and ' + SFld2 + '=''' + SVal2 + '''';
>
> If NOT FindFirst then
> begin
> If SFld1 = 'CarPre' then
> Fld := SFld2;
> MessageDlg(Fld + ' is not found', mtInformation, [mbOK], 0);
> end;
> end;
> end;