您的位置 >>> 星想互联 >>> 课堂教学 >>> 教学案例
ASP连接对象和记录集对象执行删除操作
点击数:2700  发布时间2013-04-02 15:51:25

<!--#include file="conn.asp" -->

<%
id=cint(request.querystring("id"))
if request.querystring("id")="" then
response.redirect("index.asp")
response.end
end if

'str="delete from news where id="&id
'conn.execute(str)
'response.redirect("index.asp")
 %>

<%
set rs= Server.CreateObject("adodb.recordset")
rsstr="select * from news where id="&id
rs.open rsstr,conn,1,3

rs.delete
rs.update
response.write "<script>alert('您的删除操作成功');window.location.reload('index.asp')</script>"
 %>

来源:星想互联