Subject RE: Re[2]: [IBO] Getting validation source from a domain
Author Jason L. Wharton
Helen and all,

> The way your code works doesn't change. Statement objects increment
> the RecordCount each time they fetch a record. They don't have any
> way, ahead of time, to assess what the RecordCount will be. At any
> given moment, the true record count will be RecordCount + n, where
> 'n' is the number of records left in the server's buffer, still
> waiting to be fetched. The client has no way to know what 'n' is.

I believe it is the RowNum property that increments as records are fetched
rather than the RecordCount property.

RecordCount is intended to consistently report how many records the query
will produce on the server and IBO will actually run a query on the server
to return the result of a read of this property. RecordCount makes no sense
at all for a TIB_Statement object, but it does for a TIB_Cursor since it's a
dataset it works with.

Something else to be aware of is there is a property in the TIBODataset
class that affects the behavior of the RecordCount property when being used
in the TDataset environment. This was due to the way the VCL had two modes
of behavior for record counts. I believe the propery is called
RecordCountAccurate. By setting this false it would make it so that the
TDBGrid wouldn't cause the dataset to have to fetch all the records or do a
query on the server but rather it would use an approximated record count
that would change as records are brought into the buffer.

In short, the RecordCount property is a bit of a can of worms so its worth
your time to fully research its use and how it interacts with other
features, conversations with the database server, etc.

HTH,
Jason Wharton