asp

位置:IT落伍者 >> asp >> 浏览文章

asp 删除指定记录程序代码


发布日期:2024年05月26日
 
asp 删除指定记录程序代码

这是一款asp教程 删除指定记录程序代码哦实例由点击连接到删除页面并且执行删除

<%
数据库教程连接
sub opendb()
set rs=serverCreateObject("adodbrecordset")
set conn=serverCreateObject("adodbconnection")
connconnectionstring="provider=microsoftjetoledb; data source="&servermappath("datasource/hhinfomdb")
connopen
end sub

判断是否为登陆用户

if session("username")="" and session("userpwd")="" then
responseRedirect("loginhtml")
end if
dim sqlid

获取Id由地址栏传过来的值

id=html_encode(requestQueryString("id"))
if id="" or not isnumeric(id) then
responseWrite("非法操作")
else
sql="delete * from new where id="&id
call opendb()
connexecute(sql)
if err= then
responsewrite("<script>alert(删除成功);location=wwwliannet/aasp;</script>")
else
responsewrite("<script>alert(删除失败服务器忙);location=newasp;</script>")
end if
end if
%>

使用方法
<a href="删除</a>

上一篇:asp Request.QueryString 和 Request.Form实例

下一篇:asp cookies实例教程