delphi出现Dataset not in edit or insert mode的问题如下代码procedure TStock.Button2Click(Sender: TObject);beginAdoTable2.Edit;AdoTable2.FieldValues['库存数'] := AdoTable2.FieldValues['库存数']+AdoTable1.FieldValues['进货数量'];AdoTa
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/26 14:31:32
delphi出现Dataset not in edit or insert mode的问题如下代码procedure TStock.Button2Click(Sender: TObject);beginAdoTable2.Edit;AdoTable2.FieldValues['库存数'] := AdoTable2.FieldValues['库存数']+AdoTable1.FieldValues['进货数量'];AdoTa
delphi出现Dataset not in edit or insert mode的问题
如下代码
procedure TStock.Button2Click(Sender: TObject);
begin
AdoTable2.Edit;
AdoTable2.FieldValues['库存数'] := AdoTable2.FieldValues['库存数']+AdoTable1.FieldValues['进货数量'];
AdoTable2.Post;
AdoTable1.Delete;
AdoTable1.Post;
end;
这段代码对应的退货按钮一点击就会出现错误project project1.exe
raised exception class EDatabaseError with message'ADOTable1:Dataset not in edit or insert mode'.
Process stopped.Use Step or Run to continue.”
是什么问题?
delphi出现Dataset not in edit or insert mode的问题如下代码procedure TStock.Button2Click(Sender: TObject);beginAdoTable2.Edit;AdoTable2.FieldValues['库存数'] := AdoTable2.FieldValues['库存数']+AdoTable1.FieldValues['进货数量'];AdoTa
AdoTable1.Delete;
AdoTable1.Post; //这里有问题,不要这句
TDataSet在Delete的时候都是不需要Post的