ASP的显示问题!麻烦大侠了!!5555555555!!

来源:百度知道 编辑:UC知道 时间:2024/06/21 12:37:29
<%
id=Request("id")
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.JET.OLEDB.4.0;Data Source=" & Server.mappath("Database.mdb")
Set conn=Server.CreateObject("ADODB.Connection")
conn.open connstr
set rs=server.createobject("adodb.recordset")
'sql="select * from members where newsid='"&newsid&"'"

SQL="Select * from members where id="&cint(Request("id"))
rs.open SQL,conn,1,1

If Rs.eof And Rs.bof Then
Response.write " 空!"
Response.end()
End If
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title&

假如你当前的页面为q.asp
那么前面就必须有一个页面来href这个页面,参数必须为<a href="./q.asp?id=数字">连接</a>,或者你直接打开你想知道的ID列表?id=数字,这样就可以拉...
首先我们需要了解的是cint范围 -32768 到 32767,其次你要确定这个ID是否真的存在..不存在当然会显示"空!"