procedure TForm1.Button1Click(Sender: TObject);
var
table:TclientDataSet;
i:integer;
begin
table:=TClientDataset.Create(Application);
// 添加字段定?
table.FieldDefs.Add('ID',ftInteger,0,False);
table.FieldDefs.Add('partno',ftString,10,False);
table.FieldDefs.Add('orderno',ftString,0,False);
table.CreateDataset;
table.Open;
for i:=1 to 5 do
begin
table.Append;
table.FieldByName('ID').AsInteger:=i;
table.FieldByName('partno').AsString:='sdfa';
table.FieldByName('orderno').AsString:='dfa';
table.Post;
end;
showmessage(table.FieldByName('id').AsString);
end;