Subject | Re: [IBO] is dataset empty |
---|---|
Author | Paul Vinkenoog |
Post date | 2004-01-06T02:11:47Z |
Hi Gediminas,
result. But as Luc wrote (and I just verified it -- never trust a
fellow programmer :-)) after First on an empty cursor, both Bof and
Eof are true.
OTOH: it doesn't matter *that* much, because after First or APIFirst,
testing for Eof alone is enough.
simplest test is:
- call APIFirst or First
- then test Eof
Bottom line: you MUST try to fetch a record to find out if the set
is empty.
Enough for today - now my head is empty :-)
Greetings,
Paul Vinkenoog
> The behaviour of TIB_Cursor wrt Bof and Eof on an empty datasetWrong. I tested with APIFirst and assumed First would give the same
> turns out to be:
>
> 1: Cursor prepared, but not yet opened (no Open, no First or
> APIFirst executed): Bof true, Eof false.
>
> 2: After First or APIFirst: Bof false (!), Eof true.
result. But as Luc wrote (and I just verified it -- never trust a
fellow programmer :-)) after First on an empty cursor, both Bof and
Eof are true.
OTOH: it doesn't matter *that* much, because after First or APIFirst,
testing for Eof alone is enough.
> 3. Immediately after an explicit Open: Bof true, Eof true -- but...AND if AutoFetchFirst is true! Better forget about Open. IMO the
> only if Active was false before the call to Open.
simplest test is:
- call APIFirst or First
- then test Eof
Bottom line: you MUST try to fetch a record to find out if the set
is empty.
Enough for today - now my head is empty :-)
Greetings,
Paul Vinkenoog