<!--#include file=conn.asp-->
<%
selectd=request("select")
text=request("text")
if text="" then
response.Write("<script language=javascript>alert('最少输入一个条件');location='javascript:history.go(-1)'</script>")
else
select case selectd
case "标题"
set rs2=server.CreateObject("adodb.recordset")
sql2="select * from tb_BBS where title like'%"&text&"%'order by id desc"
rs2.open sql2,conn,1,1
case "作者"
set rs2=server.CreateObject("adodb.recordset")
sql2="select * from tb_BBS where author like '%"&text&"%' order by id desc"
rs2.open sql2,conn,1,1
end select
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>论坛搜索</title>
<style type="text/css">
<!--
a:link{color:#000000;text-decoration:none} a:visited{color:#000000;text-decoration:none} a:hover{color:red;text-decoration:underline}
.STYLE1 {font-size: 12px}
.STYLE2 {
font-family: "宋体";
font-weight: bold;
color: #FFFFFF;
}
.style13 {font-size: 12px}
-->
</style>
</head>
<body background="images/kabg.gif" topmargin="0">
<table width="760" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#FF99CC">
<tr>
<td width="31" height="23" align="center" background="images/g3.gif"> </td>
<td width="528" align="center" background="images/g3.gif"><span class="STYLE2">标 题</span></td>
<td width="120" align="center" background="images/g3.gif"><span class="STYLE2">作者</span></td>
<td width="75" align="center" background="images/g3.gif"><span class="STYLE2">回复</span></td>
</tr>
<tr>
<td colspan="4">
<%
shum=30
if not rs2.eof then
tel=rs2.recordcount
rs2.pagesize=shum
maxpage=rs2.pagecount
requestpage=clng(request("p"))
if requestpage="" or requestpage=0 then
requestpage=1
end if
if requestpage>maxpage then
requestpage=maxpage
end if
if not requestpage=1 then
rs2.move (requestpage-1)*rs2.pagesize
end if
for i=1 to rs2.pagesize and not rs2.eof
%>
<table width="760" height="24" border="0">
<tr valign="top">
<td width="27" height="20" align="center" valign="middle" bgcolor="#FFCCFF"><img src="images/lock_folder.gif" width="16" height="16"></td>
<td width="527" valign="middle" bgcolor="#FFCCCC"><span class="style1"><a href="luntan2.asp?Num=<%=rs2("Num")%>&No=<%=Request("No")%>"><%=rs2("title")%></a>
</span></td>
<td width="117" align="center" valign="middle" bgcolor="#CCCCFF"><span class="style1"><font color="#800000">
<%=rs2("author")%></font></span></td>
<td width="71" align="center" valign="middle" bgcolor="#FFCCCC"><span class="style1"><font color="#800000">
<%=rs2("backcount")%></font></span></td>
</tr>
</table><%
rs2.MoveNext
if rs2.eof then exit for
next
else
response.Write("没有找到相关的发言!")
end if
%>
</td>
</tr>
</table>
<table width="760" border="0" align="center">
<tr>
<td align="right"><span class="style1">共<%= maxpage %>页 当前页:<%= requestpage %>
<a href="search.asp?p=<%=requestpage-1%>&select=<%=selectd%>&text=<%=text%>">上一页</a>
<a href="search.asp?p=<%=requestpage+1%>&select=<%=selectd%>&text=<%=text%>">下一页</a></span></td>
</tr>
</table>
</body>
</html>
<%end if%>
错误提示:
ADODB.Field (0x80020009)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
哪个热心人能认真看看,帮帮我啊 当查找信息为空的时候,不会提示没有找到信息,就是出错。
先在这里谢谢了
[此贴子已经被作者于2007-5-25 20:09:22编辑过]