程序出错,大家来看看
Set rs1 = Server.CreateObject("ADODB.Recordset")'创建记录集对象
do while pmid<>0'直到没有父类,否则继续更新 大于0大于等于0都试过
response.Write(pmid)
sql="select * from pingming where id=" &pmid'准备打开数据库的相关记录
rs1.open sql,conn,2,2'打开
pmid=cint(rs1("topid"))'将刚才数据库的上级ID号给pmid
temp1=clng(rs1("shuliang"))'将数据库中的数值给它
temp2=clng(xiang)'将表单提交的数据给它$$$$$$$$$$$$$$$$$$$$$$$0626
temp3=temp1+temp2'把数据库的数据和表单中的数据加起来
rs1("shuliang")= temp3'然后还给数据库
temp4=clng(rs1(cangku))
temp5=temp4+temp2'累加的仓库值
rs1(cangku)=temp5
rs1("uptime")= now()'并加上更新的时间,也就是最后一次入库或者出库的时间
rs1.update'OK,添加已完成
loop
id pinming xianshi paixu topid shuliang uptime 日荣一 日荣二 日荣三 日荣四
1 鱼类 0 0 2005-6-26 22:54:00 0 0 0 0
2 虾类 0 44 2005-6-27 13:02:00 14 30 0 0
3 蟹类 0 44 2005-6-27 11:12:00 32 9 2 1
4 大鱼 1 313790 2005-6-27 16:18:00 260791 52984 15 0
5 中鱼 1 467789 2005-6-27 16:17:00 12 467789 0 0
6 小鱼 1 0 2005-6-26 22:51:00 0 0 0 0
当pmid=4的时候 就老是重复执行程序 那里错了