我想你提交'update maintable set weight=weight+' +ext8.Text +'where pname=' +#39+cb1.text+#39; 后,服务器端的aqoquery的sql.text已经变这句了。可以输入出看一下。 如果改变了,问题就是这里了
procedure TForm2.btn3Click(Sender: TObject); begin if not datamodulecc.CDStoMaintable.active then begin showmessage('找找原因,这里不应该是关闭的'); exit; end; atamodulecc.CDStoMaintable.ApplyUpdates (5);end;
已经打开了啊,在程序里动态打开试一试
把它的active 设为false
如果你用datasetporvider的ApplyUpdates(Delta, MaxError, Errors),应该就没有问题的。
Delta就是Clientdataset1.Delta,其他两个参数自己定义,可以看帮助。还有一点,你的Clientdataset1是否获得过数据集,是否是通过datasetporvider获得的?自己确认一下
var
sqlstrudmaintable:string;
begin
try
datamodulecc.SC.Connected :=true;
except
showmessage('无法联结服务器,请检查服务器是否开启:-)¤');
end;
datamodulecc.CDStoMaintable.Active :=false;
sqlstrudmaintable:='update maintable set weight=weight+'
+ext8.Text +'where pname='
+#39+cb1.text+#39; with datamodulecc.CDStoMaintable do
begin
try
close;
commandtext:=sqlstrudmaintable;
execute;
//active:=true;
//open; except
showmessage('出错了,嘿嘿');
end; end;end;这一段没有什么问题!但在
procedure TForm2.btn3Click(Sender: TObject);
begindatamodulecc.CDStoMaintable.ApplyUpdates (5);begin
active:=true;
ApplyUpdates(5);
end;时,出以上问题!
begindatamodulecc.CDStoMaintable.ApplyUpdates (5);end;
+ext8.Text +'where pname='
+#39+cb1.text+#39;
后,服务器端的aqoquery的sql.text已经变这句了。可以输入出看一下。
如果改变了,问题就是这里了
begin
if not datamodulecc.CDStoMaintable.active then
begin
showmessage('找找原因,这里不应该是关闭的');
exit;
end;
atamodulecc.CDStoMaintable.ApplyUpdates (5);end;
你想用这句做什么?这句通常是把cds的delta提交服务器