Subject Re: [IBO] tib_cursor error - attempt to fetch past the last record
Author TeamIBO
> with MyCursor do begin
> if Active then Close;
> ParamByName('P_ITEMID').AsInteger := CurrentId;
> Prepare;
> Open;
> end;

You must prepare before attempting to use parameters. Something along
the lines of...

with MyCursor do begin
if not Prepared then
Prepare;
// close should not be necessary
ParamByName('P_ITEMID').AsInteger := CurrentId;
First;
end;

If you are setting multiple columns you should use...

with MyCursor do begin
if not Prepared then
Prepare;
Params.BeginUpdate;
try
ParamByName('P_ITEMID').AsInteger := CurrentId;
... other parameters ...
finally
Params.EndUpdate(true);
end;
First;
end;


> Also, does a tib_cursor need keylinks?

I am not sure if there are any exceptions to the rule, but generally
keylinks are not required with ib_cursor.


--
Geoff Worboys - TeamIBO
Telesis Computing