呵呵,按你说的方法通过了,代码如下:
<!--#include file="conn.asp" -->
<link rel="stylesheet" href="../css/mm_travel2.css" type="text/css" />
<table width="100%" height="22" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#999999">
<tr>
<td width="8%" align="center" bordercolor="#FFFFFF" bgcolor="#00CCFF" class="l11"><strong>序
号</strong></td>
<td width="12%" align="center" bordercolor="#FFFFFF" bgcolor="#00CCFF" class="l11"><strong>变电站名</strong></td>
<td width="20%" align="center" bordercolor="#FFFFFF" bgcolor="#00CCFF" class="l11"><strong>运行编号</strong></td>
<td width="20%" align="center" bordercolor="#FFFFFF" bgcolor="#00CCFF" class="l11"><strong>电压等级</strong></td>
<td width="20%" align="center" bordercolor="#FFFFFF" bgcolor="#00CCFF" class="l11"><strong>试验日期</strong></td>
<td width="20%" align="center" bordercolor="#FFFFFF" bgcolor="#00CCFF" class="l11"><strong>点击查看</strong></td>
</tr>
<%
dim flagb,bname,ynum,dydj,stype,sdate
bname=request("sousuo")
ynum=request("sousuo")
dydj=request("sousuo")
stype=request("sousuo")
sdate=request("sousuo")
%>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from byqmp where bname='"&bname&"'or ynum='"&ynum&"' or stype='"&stype&"'"
rs.open sql,conn,1,1
%>
<%if bname="" or ynum="" or dydj="" or stype="" or sdate="" then%>
<tr>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write("请填写查询内容")%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write("请填写查询内容")%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write("请填写查询内容")%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write("请填写查询内容")%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write("请填写查询内容")%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write("请填写查询内容")%></td>
</tr>
<%else if not rs.eof then%>
<%rs.movefirst%>
<tr>
<td height="22" align="center" bgcolor="#FFFFFF" class="p11"><%response.write(rs("flagb"))%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write(rs("bname"))%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write(rs("ynum"))%></td>
<td align="center" bgcolor="#FFFFFF" class="p12"><%response.write(rs("dydj"))%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write(rs("sdate"))%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write " <a href ='byqprint.asp?bname="&bname&"or ynum="&ynum&" or stype="&stype&"' Target=_blank >详细页面</a>"%></td>
</tr>
<%else if rs.bof then%>
<tr>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write("暂无此类信息")%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write("暂无此类信息")%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write("暂无此类信息")%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write("暂无此类信息")%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write("暂无此类信息")%></td>
<td align="center" bgcolor="#FFFFFF" class="p11"><%response.write("暂无此类信息")%></td>
</tr>
<%end if%>
<%end if%>
<%end if%>
</table>