Duane Atkins asked:
> The VCL source for IsEmpty looks like this:
>
> function TDataSet.IsEmpty: Boolean;
> begin
> Result := FActiveRecord >= FRecordCount;
> end;
>
> I have had problems with RecordCount returning -1 on a newly opened
> query so the reliability of IsEmpty would be questionable as well I
> assume. However I have never had a problem with EOF using D 4.02, BDE
> 5.01, IB 4.2, so perhaps it is a 5.5 problem?
If you look at the default inplementation of GetRecordCount you will see
that it just returns -1. If you look firether into the BDE code where they
override the default GetRecordCount you'll find that BDE is asked directly
about the number of records available.
The FRecordCount variable is something completly unrelated to the number of
recods returned from a query. It is, in fact, the number of valid records
available in the currently defined TDataSet buffers, and FActiveRecord is
the buffer of the current record, thus the code above is correct and works
in all cases to produce the correct answer.
Cheers, Max.
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz