我做了一个分布式系统,中间层的数据集控件用AdoQuery,并把datasetprovider的[poAllowCommandText]属性设为true。客户端的下面代码可以执行:
s:='select * from userInfo';
procedure CdsOpen(Cds:TClientDataSet;S:string);
begin
  Cds.Close;
  Cds.CommandText:=s;
  Cds.Open;
end;
但是下面的代码报错“不能删除指定的记录”:
s:='delete from userInfo';
procedure CdsExec(Cds:TClientDataSet;S:string);
begin
  Cds.Close;
  Cds.CommandText:=S;
  Cds.Execute;
end;
也就是说只能执行selec查询,delete,update都不能执行,但是如果把AdoQuery换成
Query就没问题了,请高手指点。