Page 1 of 1

TUniQuery Eof problem

Posted: Tue 13 Aug 2013 03:54
by bwilt
I was iterating through a TUniQuery SELECT using code similar to the following :-

UniQuery.First()
while (not UniQuery.Eof) do begin
UniQuery.Next();
end;

I changed to a for i := 0 to UniQuery.RecordCount - 1 do begin which works fine.

I found the Eof was not being triggered after the last record and the loop would go one more iteration.

Using UniDac 5.0.2, XE4

Re: TUniQuery Eof problem

Posted: Tue 13 Aug 2013 08:59
by AlexP
Hello,

If the UniQuery1.SpecificOptions.Values['FetchAll'] and UniQuery1.Options.QueryRecCount options are set to False, then the RecordCount property will return the number of records specified in the UniQuery1.RecordCount property. Please try setting one of these options to True and compare the behaviour of these 2 loops again.