Subject Re: [IBO] Fetching Query Results......
Author Geoff Worboys
> 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

If you are only using a single record, you could use TIB_Cursor and
save some resources on the client.

<snip...snip>

Your functions make it look like the user (or something) is provding a
company id to the edit/insert procedures. In which case I would do
something like...

...EditExistingCompany(CompanyID: integer): integer;
begin
with IB_QueryCompany do
try
if not Prepared then
Prepare;
ParamByName('C_ID').AsInteger := CompanyID;
First;
Edit;
Result := ShowModal;
<etc>

...CreateNewCompany(): integer;
begin
with IB_QueryCompany do
try
if not Prepared then
Prepare;

Insert; // notice there is no param assignment
// you do not need to open a query to insert.
{$IFDEF _CDS_}
CBCreateOffice.Visible := True;
CBCreateOffice.Checked := True;
{$ENDIF}
Append;
Result := ShowModal;
<etc>


I think the above should work. Does it acheive what you want?


Geoff Worboys
Telesis Computing