页面导航: 首页网络编程ASP编程应用技巧 → 正文内容 ASP批量更新

ASP批量更新代码

发布:dxy 字体:[增加 减小] 类型:转载
我作了一个ASP静态站,由于网站改片,所以所有静态页都要更新,原来是以时间命名为文件命,现在全部改成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 "成功....."
%>
Tags:ASP 批量更新
百度中搜索更多的关于ASP批量更新代码内容,或者用Google搜索相关更多
浏览次数:载入中... 打印本文关闭本文返回首页

文章评论

共有 位脚本之家网友发表了评论我来说两句

同 类 文 章
最 近 更 新
热 点 排 行