ClientDataSet_Master.FieldDefs.Add('BH',ftstring,8);
ClientDataSet_Master.FieldDefs.Add('path',ftstring,50);
ClientDataSet_Master.IndexFieldNames:='BH';
ClientDataSet_Master.CreateDataSet; //建立数据集
ClientDataSet_Master.Active;
var
i:integer;
a:Tfield;
begin
fcds.Close;
for i:=0 to fquery.FieldCount-1 do
begin
a:=TFieldClass(fquery.Fields[i].ClassType).Create(fcds);
a.FieldName:=fquery.Fields[i].FieldName;
a.DataSet:=fcds;
a.FieldKind:=fkdata;
end;
fcds.FieldDefs.Update;
fcds.open;
end;
with cds do
begin
with FieldDefs.AddFieldDef do
begin
DataType := ftBoolean;
Name := 'ColA';
end;
with FieldDefs.AddFieldDef do
begin
DataType := ftString;
Size := 16;
Name := 'ColB';
end;
end;
cds.CreateDataSet;
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。