先对clientdatase进行insert操作,并ApplyUpdates没有出错!
接着对它进行edit操作,这个时候ApplyUpdates就出错(clientdatase.changecount = 1)可是我不进行insert操作而操作,指进行edit操作,ApplyUpdates正常!ApplyUpdates是不是只能对提交一种操作啊?MD,还有这种事啊!这个问题该怎么解决呢?急啊,可行立马结贴

解决方案 »

  1.   

    ApplyUpdates就出错提示是什么???
      

  2.   

    楼上的,没有错误提示!我的提示错误代码是这么写的:
          Post;
          if ApplyUpdates(-1) <> 0 then
          begin
            MessageDlg('提交过程中出现错误!请从新操作!', mtError, [mbOK], 0);
            Exit;
          end;
    把MessageDlg注销了,就没有提示了,数据也写不进去
      

  3.   

    在 CLIENTDATASET的ONReconcileError 事件中加入 SHOWMESSAGE(E。MESSAGE)看看什么错误
      

  4.   

    楼上的,错误提示如下:Record not found or changed by another user
    在insert后我ApplyUpdates明明写进数据库了啊,怎么会出现这样的错误呢?
    我在Edit的时候调用refreshrecord后,就不会出错了
      

  5.   

    是“记录已被其他用户改变”你在DATEPROVIDER中选用主键跟新模式,你现在是UPWHERE模式,
    但是,我觉得的这种方法不好!!