asp问题,高手请进!!返回结果为空!!!

来源:百度知道 编辑:UC知道 时间:2024/05/16 10:35:47
<!--#include file="conn/conn1.asp"-->
<%
dim i_name,sql,rs
i_name=Trim(Request.form("i_name")) '接收患者姓名
'查询既定姓名的患者信息
set rs=createobject("adodb.recordset")
sql="select * from invalid_info where i_name='"&i_name&"'"
rs.open sql,conn,3,1
'set rs=conn.execute(sql,3)
'查询指定姓名的患者所有的就诊记录,并按照就诊时间排序
'sqld="select * from diagnose_note where d_name='"&i_name&"'"
'rs.open sqld,conn 3,1
if rs.eof and rs.bof then
response.Write"记录为空!"
else
rs.movefirst
%>
<body>
<div align="center">
<table border="1">
<tr>
<td bgcolor="#99ccff" align="center" colspan=7>
<font color="#000000"><B>患者基本信息</B></font>
</td>
</tr>
<tr align=cente

上面说的不是问题的原因
用if rs.eof and rs.bof then 是没错的

我给你分析下
i_name=Trim(Request.form("i_name")) '接收患者姓名

你用一句
response.write i_name
来检测看看这个到底是什么值
再比较一下数据库里的d_name字段里有没有这个值
无果没有这个值,说明你rs.open出来的记录是空的

if rs.eof and rs.bof then
应该改成
if rs.eof or rs.bof then