在三层应用中,数据总是不可以被删除。
说明:
后台数据库使用的是Oracel,服务器是使用的数据模块是Remote,客户端使用TDComConnection首先,TClientDataSet已经提交了删除全部记录的请求:ApplyUpdate(0);而且在客户端的TClientDataSet已经没有任何记录;但是我去数据库中还是看到了数据!为什么?

解决方案 »

  1.   

    没有更新回数据库,试试  ApplyUpdate(-1)
      

  2.   

    更新数据出现了错误,但是你没有对错误进行处理。更新数据出现错误时,会激发 TClientDataSet 的 OnReconcileError 事件。你要编写该事件的相关代码才行,另外还要添加一个 reconcile error dialog 到你的项目中。The following code shows an OnReconcileError event handler that uses the reconcile error dialog from the RecError unit which ships in the object repository directory. (To use this dialog, add RecError to your uses clause.)procedure TForm1.ClientDataSetReconcileError(DataSet: TCustomClientDataSet; E: EReconcileError; UpdateKind: TUpdateKind; var Action TReconcileAction);begin
      Action := HandleReconcileError(DataSet, UpdateKind, E);
    end;