unit Unit1;
interface
uses
Winapi.Windows,
Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
Vcl.Graphics,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs, Data.DBXMySQL, Data.FMTBcd, Data.DB,
Data.SqlExpr,
Vcl.StdCtrls,
Vcl.Buttons,
Vcl.Grids,
Vcl.ExtCtrls;
type
TForm1 =
class(TForm)
Panel1: TPanel;
StringGrid1: TStringGrid;
StringGrid2: TStringGrid;
Panel2: TPanel;
BitBtn1: TBitBtn;
SQLConnection1: TSQLConnection;
SQLQuery1: TSQLQuery;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
var
i,ncol,z: integer;
uid :
string;
begin
for nCol := 0
to stringgrid1.ColCount - 1
do
begin
stringgrid1.Cols[nCol].Clear;
end;
stringgrid1.Cells[0,0] := '
ID';
stringgrid1.Cells[1,0] := '
UID Κάρτας';
stringgrid1.Cells[2,0] := '
Πόντοι';
stringgrid1.Cells[3,0] := '
Πόντοι Σύνολο';
stringgrid1.Cells[4,0] := '
Ημερομηνία';
stringgrid1.Cells[5,0] := '
Ώρα';
sqlquery1.sql.Clear;
SQLquery1.SQL.add ('
Select id,UID,points,TotalPoints,date,time from karta');
sqlquery1.open;
SQLquery1.First;
i:=0;
while not SQLquery1.EOf
do begin
i:=i+1;
stringgrid1.RowCount := i+2;
stringgrid1.Cells[0,i] := inttostr(SQLquery1.Fieldbyname('
id').asinteger);
stringgrid1.Cells[1,i] := SQLquery1.Fieldbyname('
UID').asString;
stringgrid1.Cells[2,i] := inttostr(SQLquery1.Fieldbyname('
points').asinteger);
stringgrid1.Cells[3,i] := inttostr(SQLquery1.Fieldbyname('
TotalPoints').asinteger);
stringgrid1.Cells[4,i] := SQLquery1.Fieldbyname('
date').asString;
stringgrid1.Cells[5,i] := SQLquery1.Fieldbyname('
time').asString;
SQLquery1.Next;
end;
sqlquery1.sql.Clear;
end;
end.