当前位置:主页 > 查看内容

ASP批量更新代码

发布时间:2021-07-07 00:00| 位朋友查看

简介:!--#includefile="../Conn.asp"-- % setrs=server.createobject("adodb.recordset") sql="select*fromarticlewherebigtypes='我爱你'orderbyiddesc"找出数据库内类别为我爱你的所有数据 rs.opensql,conn,1,3 ifnotrs.eofthen dowhilenotrs.eof fname=rs("id"……
<!--#include file="../Conn.asp"-->
<%
set rs=server.createobject("adodb.recordset")
sql="select * from article where bigtypes='我爱你'order by id desc"   找出数据库内类别为我爱你的所有数据
rs.open sql,conn,1,3
if not rs.eof then
do while not rs.eof
fname = rs("id")&".html"
folder = "../html/Info/"
c_filepath = folder&fname

rs("filepath")=c_filepath
rs.update

rs.movenext
loop
end if
response.redirect "成功....."
%>
解决方法:
复制代码 代码如下:

<%
set rs=server.createobject("adodb.recordset")
sql="select * from article where bigtypes='我爱你'order by id desc"   找出数据库内类别为我爱你的所有数据
rs.open sql,conn,1,3
if not rs.eof then
do while not rs.eof
fname = rs("id")&".html"
folder = "../html/Info/"
c_filepath = folder&fname

conn.execute("update article set filepath='"&c_filepath&"' where id="&rs("id"))

rs.movenext
loop
end if
response.redirect "成功....."
%>

原文链接:https://m.jb51.net/article/13702.htm
本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!

推荐图文


随机推荐