Subject Re: [IBO] Fastest way to check to see if query returned a result
Author Geoff Worboys
Hi ra8009,

> Now I'm assigning my parameter, calling First, and then
> checking (EOF and BOF). Both EOF and BOF are true even
> though there's one record being returned.
> What am I doing wrong?

How do you know a record is being returned? (Hint: Using
TIB_MonitorDialog can help you see what is actually
happening.)

The code itself should be very simple.

Single/first record processing:
with ACursor do
begin
ParamByName('APARAM').AsInteger := 0;
First;
if not Eof then
do_something;
Close;
end;

Multiple record processing:
with ACursor do
begin
ParamByName('APARAM').AsInteger := 0;
First;
while not Eof do
begin
do_something;
Next; // DONT FORGET THE CALL TO NEXT
end;
Close;
end;

--
Geoff Worboys
Telesis Computing