IsEmpty
function IsEmpty: Boolean;
Example
procedure CheckForRows(const Data: TvxClientDataSet; var HasRows: Boolean);
begin
HasRows := Data.Active and not Data.IsEmpty;
end;
Usage
IsEmpty reports whether the dataset currently has no active buffered record.
- Combine with Active when inactive must be distinguished from empty.
- Do not use this as authorisation, source-system existence proof or full-count query.
- For
TvxClientDataSet, open normally fetches the complete result because fetch-on-demand is disabled; generic datasets can differ.
Additional Technical Info
IsEmpty is declared by hidden ancestor TDataSet and is normally used through a visible descendant such as TvxClientDataSet. It is a cursor/buffer test, not a database existence query.
Source-backed behaviour
The modified base returns FActiveRecord >= FRecordCount. After close/initialization that is also true, so inactive and active-empty datasets are indistinguishable without checking Active. A normal active TCustomClientDataSet returns false when a current buffered record exists.
The method does not issue SQL, count remote rows or force a provider fetch by itself. Descendant buffer/fetch state determines what is currently known.
Related members
RecordCount is descendant count metadata. BOF and EOF are boundary flags.