#1 2010-11-18 05:45:37

JonG
Member
Registered: 2010-11-12
Posts: 7

retrieving multiple records

procedure TForm1.LoadPersonList;
var
  PersonRec : TSQLPersonRecord;
begin
  PersonRec:=TSQLPersonRecord.Create(Database,'Name>""',[]);
  Try
    if PersonRec.ID = 0 then
      Exit;
    Repeat
      ListBox1.Items.Append(UTF8ToString(PersonRec.Name));
    until not PersonRec.FillOne;
  Finally
    PersonRec.Free;
  End;

end;

This code is not working.  I know there are multiple records in the table but only the first record comes up.

What am I doing wrong?  :-)

Many thanks.

Last edited by JonG (2010-11-18 05:46:49)

Offline

#2 2010-11-18 08:17:28

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: retrieving multiple records

You need to use TSQLTableJSON to retrieve multiple records, then FillOne/FillPrepare.

See http://synopse.info/forum/viewtopic.php?pid=729#p729 for an example.

Offline

Board footer

Powered by FluxBB