Subject Fetching Query Results......
Author Marc Leclerc
Hi all,

funny the things that appear when running on a slow link. I have a form (actually a few like this) that allow editing of a single row (No scrolling). So I have a query set like this

SELECT *
FROM TBLCOMPANY
WHERE COMPANY_ID = :C_ID

There are a few linked dadaset with lookup data. The company table have for now 2030 rows.

Here is what i have setup in the form to activate edit, insert or view. Now my problem is that when called on a slow link I see a message "fetching query results" Row : ... and it fetches the whole dataset. My first attempt was to set FetchWholeRows to false with no improvement.

Any help appreciated

procedure TEditCompanyDlg.OpenDataset;
var
i: integer;
begin
for i := 0 to ComponentCount - 1 do
begin
if Components[i] is TIB_Query then
with Components[i] as TIB_Query do
if not Active then
begin
Prepare;
Open;
end;
end;
end;

function TEditCompanyDlg.EditExistingCompany(CompanyID: integer): integer;
begin
Screen.Cursor := crDefault;
IB_QueryCompany.ParamByName('C_ID').AsInteger := CompanyID;
try
OpenDataset;
IB_QueryCompany.Edit;
Result := ShowModal;
except
on E: Exception do
begin
ShowMessage(E.Message); //ADD LOCALISED MESSAGE
Result := mrAbort;
end;
end;
end;

function TEditCompanyDlg.CreateNewCompany(): integer;
begin
Screen.Cursor := crDefault;
IB_QueryCompany.ParamByName('C_ID').AsInteger := -1;
try
OpenDataset;
{$IFDEF _CDS_}
CBCreateOffice.Visible := True;
CBCreateOffice.Checked := True;
{$ENDIF}
IB_QueryCompany.Append;
Result := ShowModal;
except
on E: Exception do
begin
ShowMessage(E.Message); //ADD LOCALISED MESSAGE
Result := mrAbort;
end;
end;
end;



[Non-text portions of this message have been removed]