给分,感射大家,我已经在Delphi6从入门到精通这本书中找到了答案,继承TADOConnection 添加一个公共函数 function TADOConnectionX(ADODataSet: TCustomADODataSet):Boolean begin with TADODataSet.Create(nil) do begin try Clone(ADODataSet); FilterGroup := fgPendingRecords; Filter := true; Result := not (Eof and Bof); finally Free; end; end; end;
afterdelete 和afterpost后修改,提交或撤取提交后还原
做三层时clientdataset有个changecount很好用的,可ado没有
添加一个公共函数
function TADOConnectionX(ADODataSet: TCustomADODataSet):Boolean
begin
with TADODataSet.Create(nil) do
begin
try
Clone(ADODataSet);
FilterGroup := fgPendingRecords;
Filter := true;
Result := not (Eof and Bof);
finally
Free;
end;
end;
end;