当前位置:编程学习 > asp >>

ASP批量更新代码

答案:<!--#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 "成功....."
%>

上一个:asp飞飞无限级分类v1.0 Asp+sql+存储过程+ajax提供下载
下一个:一想千开PJblog审核功能补丁 v2.0版 发布第1/3页

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,