[Lazarus] Inactive Dataset

Graeme Geldenhuys graemeg.lists at gmail.com
Wed May 28 10:45:32 CEST 2008


2008/5/28 Dave Coventry <dgcoventry at gmail.com>:
>
> SQLQuery1.SQL.Text:='SELECT fname,
> sname,id,comboboxcourse,studentnumber,enquirydate,enquiryreferencenumber
> from registration WHERE fname=''Dave''';
>  StringGrid1.RowCount:=2;
>  SQLQuery1.SQL.Text:=sqlq;
>  SQLQuery1.Open;
>  SQLQuery1.First;
>  while not SQLQuery1.EOF do
>  begin
>    StringGrid1.Cells[0,i]:=SQLQuery1.FieldByName('fname').AsString;
>    StringGrid1.Cells[1,i]:=SQLQuery1.FieldByName('sname').AsString;
>    StringGrid1.Cells[2,i]:=SQLQuery1.FieldByName('id').AsString;
>    StringGrid1.Cells[3,i]:=SQLQuery1.FieldByName('comboboxcourse').AsString;
>    StringGrid1.Cells[4,i]:=SQLQuery1.FieldByName('studentnumber').AsString;
>    StringGrid1.Cells[5,i]:=SQLQuery1.FieldByName('enquirydate').AsString;
>    RecNumber:=RecNumber+','+SQLQuery1.FieldByName('enquiryreferencenumber').AsString;
>    inc(i);
>    StringGrid1.RowCount:=i+1;

You forgot the line:
   SQLQuery1.Next;

>  end;
>  SQLQuery1.Close;
>



Regards,
 - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the Lazarus mailing list