<%
id=trim(request("id"))
set rs=server.createobject("ADODB.recordset")
sql="select * from msg where ID=" & CLng(id)
rs.open sql,conn,1,3
if not rs.eof then
do while not (rs.eof or rs.bof)
rs.Delete
rs.movenext
loop
end if
rs.close
set rs=nothing
conn.Close
set conn = nothing
Response.Write("删除成功")
%>
先用trim 去点传递参数的空格
然后用clng函数把ID转换为长整型
负责数据查询不到记录