一般的修改可以使用sql语句或者rs.update来提交

当需要循环修改时,不需要rs.update,比较奇怪

下面是一个统一个产品,不同录入时间的的数量循环减少

sqlstr="select  * from pro_style where style_p

set  rsup=server.CreateObject("adodb.recordset")
rsup.open sqlstr,conn,1,3
tempnum=-1
tempshulian=10

do while not rsup.eof and not rsup.eof
  if tempnum>-1 then exit do
  tempnum=rsup("style_num")-tempshulian
 
   if tempnum<0 then
     '如果这条数量不够减
  tempshulian=tempshulian-rsup("style_num")
     rsup("style_num")=0
 
   else
    '数量够减或有多
    rsup("style_num")=tempnum
   end if
 
  rsup.movenext
loop
 'rsup.update
rsup.close
set rsup=nothing

 

相关文章:

  • 2022-02-24
  • 2021-05-24
  • 2022-12-23
  • 2021-12-15
  • 2021-11-08
  • 2022-02-10
  • 2021-08-30
  • 2021-06-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2021-08-08
  • 2021-06-25
  • 2021-10-08
  • 2022-12-23
相关资源
相似解决方案