ASP批量更新代碼
更新時間:2008年03月08日 23:38:42 作者:
我作了一個ASP靜態(tài)站,由于網(wǎng)站改片,所以所有靜態(tài)頁都要更新,原來是以時間命名為文件命,現(xiàn)在全部改成ID命名,但數(shù)據(jù)庫內(nèi)的保存地址的那個字段無法更新,請各位大蝦指點一二,小弟不勝感激...................
<!--#include file="../Conn.asp"-->
<%
set rs=server.createobject("adodb.recordset")
sql="select * from article where bigtypes='我愛你'order by id desc" 找出數(shù)據(jù)庫內(nèi)類別為我愛你的所有數(shù)據(jù)
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" 找出數(shù)據(jù)庫內(nèi)類別為我愛你的所有數(shù)據(jù)
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 "成功....."
%>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from article where bigtypes='我愛你'order by id desc" 找出數(shù)據(jù)庫內(nèi)類別為我愛你的所有數(shù)據(jù)
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 "成功....."
%>
解決方法:
復(fù)制代碼 代碼如下:
<%
set rs=server.createobject("adodb.recordset")
sql="select * from article where bigtypes='我愛你'order by id desc" 找出數(shù)據(jù)庫內(nèi)類別為我愛你的所有數(shù)據(jù)
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 "成功....."
%>
相關(guān)文章
ASP多條件查詢功能實現(xiàn)代碼(多關(guān)鍵詞查詢)
今天在用asp增加一個多條件查詢,標(biāo)題可以包括多個關(guān)鍵詞,這樣提高匹配,防止內(nèi)容重復(fù)等2014-05-05SaveRemoteFile函數(shù)之a(chǎn)sp實現(xiàn)保存遠(yuǎn)程的文件到本地的代碼
SaveRemoteFile函數(shù)之a(chǎn)sp實現(xiàn)保存遠(yuǎn)程的文件到本地的代碼...2007-09-09響應(yīng)對象 錯誤 ''ASP 0185 : 80020003'' 缺少默認(rèn)屬性
發(fā)現(xiàn)個垃圾后臺用了大量的Response.Cookies,導(dǎo)致后臺認(rèn)證出錯。2007-12-12asp中去除html中style,javascript,css代碼
剔除頁面中html中除文字以外的任何代碼,剛才發(fā)布了php版這個是ASP中的版本。2010-10-10在asp中通過vbs類實現(xiàn)rsa加密與解密的代碼
在asp中通過vbs類實現(xiàn)rsa加密與解密的代碼...2007-03-03