Criar campos em runtime no ClientDataSet

Delphi

04/04/2005

Preciso criar vários campos em runtime no ClientDataSet, como faço?


Biohazard

Biohazard

Curtidas 0

Respostas

Kotho

Kotho

04/04/2005

Eu uso assim:

ClientDataSet1 := TCustomClientDataSet.Create(Self);
with ClientDataSet1 do
begin
  with FieldDefs.AddFieldDef do
  begin
    DataType := ftString;
    Name := ´Campo´;
  end;
  with FieldDefs.AddFieldDef do
  begin
    DataType := ftString;
    Name := ´Valor´;
  end;
  CreateDataSet;
end;



GOSTEI 0
POSTAR