最近的作的一个三层结构系统中,在客户端更新数据到数据库我用了TCLIENTDATASET.APPLYUPDATES(0)方法结果没报错却在数据库中没有记录,这是为何?
请帮忙,谢谢。

解决方案 »

  1.   

    DataSetProvider.Exported:=True试了没呢?
      

  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;
      

  3.   

    先用 leapmars(流铭)的方法看看提示信息是什么?如果是record not found or record change by another user,那什么可能是你数据表中表默认值或有自增ID,把默认或自增ID去掉,或
    在APPLYUPDATS()之后用Refresh刷新一下客户端数据