[Lazarus] Accessing MS SQLServer database from Lazarus/FPC?

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Tue Jan 25 10:13:42 CET 2011


Bo Berglund wrote:

> Both work, but return only one record (there should be 4).
> Or at least the code loop below only traverses once:
> 
>   while not query.EOF do
>   begin
>     S := S + query.FieldByName('AppNo').AsString + #13#10;
>     query.Next;
>   end;

What happens if you put an explicit .First before the loop?

   query.Active:= true;
   query.First;
   while not query.EOF do
   begin
     S := S + query.FieldByName('AppNo').AsString + #13#10;
     query.Next;
   end;

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]




More information about the Lazarus mailing list