问题1: 原sl=100
Cn1.BeginTrans
cn1.Execute "update kc set sl = sl - 100 " 退库
cn1.execute "update kc set sl = sl + 200 " 更新库存
cn1.CommitTrans
如上将100退回后,重新入库200,最后 sl为什么是 300
该如何解决以上问题(修改入库单)
问题2:
打开rs2
Cn1.BeginTrans
cn1.Execute "update kc set sl = sl - 100 " 退库
cn1.RollbackTrans
现在将不能访问RS2吗?
我只要访问RS2 将提示"意外错误"
问题1:
你没有写错误捕捉的程序,可能
cn1.Execute "update kc set sl = sl - 100 " 退库
出错了,但没有捕捉。
问题2:
和你rs2打开的方式有关。
还应该在你加的错误处理里面加上事务的回滚操作,否则也不行