Subject | Re: [IBO] Fastest way to check to see if query returned a result |
---|---|
Author | Geoff Worboys |
Post date | 2006-04-27T06:07:46Z |
Hi ra8009,
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
> Now I'm assigning my parameter, calling First, and thenHow do you know a record is being returned? (Hint: Using
> checking (EOF and BOF). Both EOF and BOF are true even
> though there's one record being returned.
> What am I doing wrong?
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