TUniQuery Eof problem

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
bwilt
Posts: 15
Joined: Wed 07 Aug 2013 01:45

TUniQuery Eof problem

Post by bwilt » Tue 13 Aug 2013 03:54

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TUniQuery Eof problem

Post by AlexP » Tue 13 Aug 2013 08:59

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.

Post Reply