请看数据集的源代码procedure TDataSet.Post;begin [red]UpdateRecord;[/red] case State of dsEdit, dsInsert: begin DataEvent(deCheckBrowseMode, 0); DoBeforePost; [red]CheckOperation(InternalPost, FOnPostError);[/red]//这里确认更新操作~~ FreeFieldBuffers; SetState(dsBrowse); Resync([]); DoAfterPost; end; end;end;procedure TDataSet.Delete;begin CheckActive; if State in [dsInsert, dsSetKey] then Cancel else begin if FRecordCount = 0 then DatabaseError(SDataSetEmpty, Self); DataEvent(deCheckBrowseMode, 0); DoBeforeDelete; DoBeforeScroll; [red]CheckOperation(InternalDelete, FOnDeleteError);[/red]//这里确认删除操作 FreeFieldBuffers; SetState(dsBrowse); Resync([]); DoAfterDelete; DoAfterScroll; end;end;procedure TDataSet.CheckOperation(Operation: TDataOperation; ErrorEvent: TDataSetErrorEvent);var Done: Boolean; Action: TDataAction;begin Done := False; repeat try UpdateCursorPos; Operation; Done := True; except on E: EDatabaseError do begin Action := daFail; if Assigned(ErrorEvent) then ErrorEvent(Self, E, Action); if Action = daFail then raise; if Action = daAbort then SysUtils.Abort; end; end; until Done;end;