在线等待:如何解决“Command out of sync;You can't run this command now.”错误
我的编程环境是Delphi 7+MySQL,采用了DBExpress下的TSQLConnection和,以及TDataSetProvider/TClientDataSet/TDataSource来访问MySQL中的表。在提交表时出现“Command out of sync;You can't run this command now.”错误
部分代码如下(数据集是处于连接状态能显示数据):
with DataModule1.ClientDataSetInput do
begin
if Not ( State in [dsInsert,dsEdit]) then
Edit;
FieldByName('IC_ID').AsInteger:= 0;
Post; //这一行应该是不需要的
if (ChangeCount > 0) then //这一行有时会出现为False的情况
ApplyUpdates(-1); //运行到这一行时出现以上错误
不知如何处理,请高手指点?