用ClientDataSet1.ApplyUpdates(0)或ClientDataSet1.ApplyUpdates(-1)都不行,
我中间层用的是adoquery,客户端用的是dcom,请问要做什么设置才能修改数据啊?

解决方案 »

  1.   

    服务器端的DataSetProvider有一个Options属性项,里面有许多是否允许客户端修改数据的设置,比如ReadOnly, AllowCommandText, DisableEdits等,对它进行适当设置即可!
      

  2.   

    一楼说的不行啊,它们默认的为false,还要设置吗?将allowcommandtext设置为true也没用
      

  3.   

    to ganwendong请给出代码啊以及要设置的属性?
      

  4.   

    比如客户端 datamodule2.DCOMConnection1.AppServer.appadd(‘123’);
     appadd是服务器端的定义的一个方法或函数接口
       服务器端 procedure Twoku.appadd (const  count: WideString);
    begin    SQLText:='insert into abc(b) values( '+''''+count+''''+')';
        adocommand1.CommandText:=SQLText;
        ADOCommand1.Execute;
    其他设置你就应该会的!  
      

  5.   

    ganwendong(无为) 的方法是可以的,你出的“灾难性故障”是什么?请楼主贴出出错代码
      

  6.   

    中间层
    procedure Tserversample.Method3(const a: WideString);
    begin
    adoquery1.SQL.Text:='insert into table1 (dangan) values ('''+a+''')';
    adoquery1.ExecSQL;
    end;客户端
    procedure TForm3.Button3Click(Sender: TObject);
    begin
    dcomconnection1.AppServer.Method3(edit1.Text);
    end;
      

  7.   

    你是否将查询和修改数据都用adoquery1啊