分页问题 asp 急求!

来源:百度知道 编辑:UC知道 时间:2024/05/24 01:25:04
在网址后面加上?id=xx 然后就显示数据库中id为这个的数据 如果不存在就显示"不存在" 我做了一个 当存在这个数据的时候正常 不存在就会出问题! 怎样写代码??
饿 我的代码太.... 都是错的 就帮我写一段吧

'...数据库连接略....
<%
id=Request("id")
if id="" or IsNumeric(id)=false then
response.Write"<script language=javascript>alert('参数不能为空或参数错误!');history.back(-1);</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "SELECT * FROM 表名 where id="&id,conn,1,1
if rs.Eof and rs.Bof then
response.Write"<script language=javascript>alert('该记录不存在!');history.back(-1);</script>"
response.end
end if
%>
后面代码....................