+ -
当前位置:首页 → 问答吧 → rs loop什么时候update比较好?

rs loop什么时候update比较好?

时间:2011-10-08

来源:互联网

我要同时执行表中的1000条记录,循环。。然后对每条记录都要修改。

那么,是在每更改一条记录就条用update 还是 全部循环执行完了,再调用update?
哪种好?

sql=".........."
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
do while not rs.eof
  rs("xxxxxx")="dddddddddd"
  rs.update '这里调用???
loop 
'rs.update '还是 这里调用???

rs.close
set rs=nothing

作者: fisherboy   发布时间: 2011-10-08

为啥要用do while not rs.eof??

直接UPDATE不行吗??
sql=".........."
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs("xxxxxx")="dddddddddd"
rs.update 

作者: sy_binbin   发布时间: 2011-10-08