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
TUniQuery Eof problem
Re: TUniQuery Eof problem
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.
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.