1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| procedure TForm1.Button1Click(Sender: TObject);
var t,i,j,k:integer;
typval:string;
LeType : String;
begin
j:=2;
i:=20;
k:=1;
Adodataset1.CommandText := 'Select * from Sample01' ;
Adodataset1.Active := true;
for t:=0 to adodataset1.FieldCount-1 do
begin
inc(Nombre);
SetLength(listeradio , Nombre+1);
listeradio[Nombre] := Tradiobutton.Create(self);
case Adodataset1.Fields.Fields[t].DataType of
ftInteger: LeType := 'Interger';
ftString: LeType := 'String';
// a toi de faire les autres types
else
LeType := 'Inconnu';
end;
with listeradio[Nombre] do
begin
Parent := panel1;
Left := 10;
Top :=10+j;
Width := 100;
Caption := adodataset1.Fields.Fields[t].FieldName + ' ' + LeType;
end;
// je besoin du type de chaque attribut.
i:=i+20;
j:=j+30;
end;
end; |
Partager