procedure TForm1.ClientDataSet1NewRecord(DataSet: TDataSet); begin ShowMessage('你好'); ClientDataSet1.First; while not ClientDataSet1.Eof do begin ClientDataSet1.Edit; ClientDataSet1.FieldByName('ID').AsInteger := ClientDataSet1.RecNo; ClientDataSet1.Next; end; end; procedure TForm1.FormCreate(Sender: TObject); begin ClientDataSet1.Open; ClientDataSet1.Edit; end;