asp连接数据库代码实例(16)
发布时间:2021-06-06
发布时间:2021-06-06
asp 连接数据库代码实例
rs("hits")=hits
rs.update
conn.close
set rs=nothing
response.write "<script language=javascript>alert('编辑成功!');location.href('?id="&request("id")&"&action=edit');</script>"
end if
%>
删除文件
<a title="删除这个?" href="delfile.asp?id=<%=rs("id")%>&struploadfiles=<%=rs("picurl")%>&action=delsoftpic" onClick="{if (confirm('您确定要删除这个吗?')){return true;}return false;}"><font color="#FF0000">删除</font></a>
--------------------------------
--*delfile.asp内容*---
<%if request("action")="delsoftpic" then
picurl=request.form("picurl")
set rs=server.createobject("adodb.recordset")
sql="select * from biao where id="&request("id")&""
rs.open sql,conn,3,2
rs("picurl")=null
struploadfiles=trim(request.querystring("struploadfiles"))
action=trim(request.querystring("action"))
dim fso,arruploadfiles,i
set fso = createobject("scripting.filesystemobject")
fso.deletefile(server.mappath("" & struploadfiles))
set fso = nothing
rs.update
conn.close
set rs=nothing
response.write"<script language='javascript'>alert('删除成功!');location.href('edit.asp?id="&request("id")&"&action=edit');</script>"
end if
%> <a href="javascript:history.back();">[返回] </a>
8。有关ubb