with Query1 do
 begin
  Close;
  SQL.Clear;
  SQL.Add('select * from template');
  SQL.Add('where id="'+Edit1.Text+'"');
  open;  if Query1.RecordCount>0 then
  begin
   for i:=0 to Query1.RecordCount-1 do
   begin
    RBn[i]:=TRadioBuoon.Create(self);//RBn:array of TRadioButton
    RBn[i].Parent:= Panel1;
    RBn [i].Width:=20;
    RBn[i].Height:=3;
    RBn[i].Left:=(RBn[i].Height)*(i-1);
    RBn[i].Top:=(RBn[i].Width)*(i-1);
    RBn[i].Caption:=FieldByName('name').AsString;
    next;
   end;
   end;
  end;