asp 删除不了数据

来源:百度知道 编辑:UC知道 时间:2024/06/27 16:38:51
<!--#include file="conn.asp"-->
<%
if session("tel")="" then
response.redirect "login.asp"
end if

theid=request("id")
if isnumeric(theid)=false then
response.write "<script>alert('参数错误,关闭窗口!');window.close();</script>"
response.end
end if

sql="select * from telsearch where theid=cint('"&theid&"')"
set rs=server.createobject("adodb.recordset")
rs.open sql,connstr,1,3
if not rs.eof then
rs.delete
rs.update
response.redirect "list.asp"
end if
%>

你这个是查询语句!
不是删除的,当然不行了!

<!--#include file="conn.asp"-->
<%
if session("tel")="" then
response.redirect "login.asp"
end if

theid=Cint(request("id"))
if isnumeric(theid)=false then
response.write "<script>alert('参数错误,关闭窗口!');window.close();</script>"
response.end
end if

Conn.Execute("delete from telsearch where theid="&theid)
Conn.close:set Conn=nothing
response.redirect "list.asp"
%>

很简单的。。其实一点代码就可以了...
http://www.phpxd.com/jishuwenzhang/2009-02-07/200902072221020.html
这里有个你试试

有错误提示吗?