在客户端用Tclientdataset的commandtext向服务器下达数据请求命令。服务端的Tdatasetprovider的poallowcommandtext已设置为true,但在执行时却发生如下错误: can not perform this operation on an open dataset.怎么回事?
是不是在打开Tclientdataset前没有先关闭。如下: cds1.close; cds1.commandtext:='select * from table1'; cds1.open; 再说,你的commandtext怎么写的?最好贴出代码来,让大家给你看看。
NO.1 TClientDataSet - > TDataSetProvider.DataSet.SQL := '....'; with ClientDataSetX do begin if Active then Active := False; CommandText := 'Select * from TableName'; Active := True; end; NO.2: TDataSetClient.DataRequest := 'Sele....';//过时了;
cds1.close;
cds1.commandtext:='select * from table1';
cds1.open;
再说,你的commandtext怎么写的?最好贴出代码来,让大家给你看看。
TClientDataSet - > TDataSetProvider.DataSet.SQL := '....';
with ClientDataSetX do
begin
if Active then
Active := False;
CommandText := 'Select * from TableName';
Active := True;
end;
NO.2:
TDataSetClient.DataRequest := 'Sele....';//过时了;