Subject RecordCount problem with TIBODataset
Author Jason Wharton
Here is the code that resets the flag for the cursor record count being
valid or not in regard to the changing of an input parameter value. It is a
little mired by having the RefreshOnParamChange being set to false, which is
the case for the TDataset compatible components. Because this is false it
did not reset this flag at the time the value had changed and nothing was
triggered later on (closing and reopening) when the parameter change did
actually have an effect on the records returned to the dataset.

In order to make this work the way it should, I need to make it so that it
will delay the setting of the flag until the dataset is closed. Then, when
the dataset is opened again (and the new input parameters will take effect)
the record count flag needs to indicate that a new select needs to be
executed if another call to RecordCount takes place.

The code below contains what should work fine as a temporary fix to this

This is from the include file: IBA_Dataset.IMP around line # 400.

procedure TIB_Dataset.SysAfterParamsDataChange( Sender: TIB_Row;
AField: TIB_Column );
inherited SysAfterParamsDataChange( Sender, AField );
FParamWasChanged := true;
if RefreshOnParamChange or ( MasterDataChangeLevel > 0 ) then
if Active and not IsPosting and not NeedToPost then
if Fetching then
// Line below used to be here and was missed if RefreshOnParamChange was
// Moved here so that it would always get flagged and reset the need for the
count to change.
FCursorRecordCountValid := false;
FParamWasChanged := false;

Jason Wharton
CPS - Mesa AZ