我用的是MYSQL的数据库,下面是一部分代码
rst.movefirst
Do While Not rst.EOF
lt = weight_time * rst("product_ltd") * rst("product_ce")
dl = weight_quantity * rst("product_qd") * rst("product_ce")
ql = weight_quality * rst("product_rq") * rst("product_cu")
c = rst("product_cd") / rst("product_qo")
pr = (weight_price * rst("product_qo") * c) + rst("product_fd") + rst("product_ca")
vp = Format((rst("product_cu") * rst("product_qo")) / (lt + dl + ql + pr), "###0.00000")
rst("com_weight") = vp * 1000
rst.Update
rst.MoveNext
Loop我可以肯定其它代码以及以上的计算过程不存在问题
现在遇到的问题是昨天晚上还可以更新数据库中com_weight字段的值,到了第二天再测试就报告了一个这样的错误“无法为更新定位行,一些值可能已在最后一次读取后已更改”
请教各位高手,可能错在哪?怎么修改代码?