Subject Re[2]: [IBO] Getting validation source from a domain
Author Helen Borrie
At 12:29 AM 19/10/2006, you wrote:
>Helen,
>
>Wednesday, October 18, 2006, 10:10:35 AM, you wrote:
>
> >> result := lCursor.RecordCount > 0;
>
> > RecordCount is meaningless. An IB_Cursor doesn't know about it. It
> > has a single-row buffer.
>
>I've got tons of lines similar to
>
> [...]
> curCHTEbrw.First();
> CursorRows := curCHTEbrw.RecordCount;
> RowsCount := 0;
> while (
> (not curCHTEbrw.Eof)
> and
> (not AbortSQL)
> )
> do begin
> [...]
> curCHTEbrw.Next();
> RowsCount := RowsCount + 1;
> if ((RowsCount mod ProgStep)=0) then begin
> ProgressBar.Position := Round((RowsCount*100) / CursorRows);
> Application.ProcessMessages();
> end;
> [...]
> end;
> [...]
>
>and all of them work as intended, curCHTEbrw.RecordCount returning a
>value that reflects exactly the value RowsCount will have when EOF
>is reached. Has anything changed in this regard?

No.

>Will this be a source for potential problems if I need to upgrade
>(currently Delphi 5 and IBO 4.2Ie)?

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.

Helen