<%t_name = TRIM(request("t_name"))
class_search_id = TRIM(request("class_search_id"))
rpagesize = 40
DIM rpage,rROWCOUNT
SET RS_maga=SERVER.CREATEOBJECT("ADODB.Recordset")
RS_maga.MAXRECORDS=maxrecords
RS_maga.PageSize=rpagesize
if t_name <> "" then
if class_search_id="-1" then
searchSql = "select * from lw_mag where mag_name like '%"&t_name&"%' order by mag_id desc"
else
searchSql="select * from lw_mag where mag_issn like '%"&t_name&"%' or mag_cn like '%"&t_name&"%' order by mag_id desc"
end if
else
searchSql = "select * from lw_mag order by mag_id desc"
end if
if class_search_id_int > -1 then
searchStr_comm = "&class_search_id=" & class_search_id
else
searchStr_comm = ""
if t_name <> "" then searchStr_comm = searchStr_comm & "&t_name=" & server.URLEncode(t_name)
searchStr = searchStr_comm
end if %>
。。。。。。。。。。。。。。。。。。。。。(html)显示部分就省了
<% RS_maga.OPEN searchSql,conn,1,1
if not RS_maga.eof then
IF TRIM(REQUEST("rpage"))="" THEN
rpage = 1
else
rpage=cint(TRIM(REQUEST("rpage")))
end if
RS_maga.ABSOLUTEPAGE = rpage
end if
%>
<%
rROWCOUNT = 0
WHILE NOT RS_maga.EOF AND rROWCOUNT < RS_maga.PageSize
response.write "<tr>"
response.write "<td width=""13"" height=""25"">"
response.write " </td>"
response.write "<td width=""120"" height=""25"" >"
response.write RS_maga("mag_special")
response.write "</td>"
response.write "<td width=""200"" height=""25"" >"
if has_login or true then
response.write "<a href=""magdomestic.html/m_id/"&rs_maga("mag_id")&" "" target=""_blank"">"
response.write rs_maga("mag_name")
response.write "</a>"
else
response.write rs_maga("mag_name")
end if
response.write "</td>"
response.write "<td width=""70"" height=""25"" >"
response.write RS_maga("mag_level")
response.write "</td>"
response.write "<td width=""120"" height=""25"" >"
response.write RS_maga("mag_d_unit")
response.write "</td>"
RS_maga.MOVENEXT
rROWCOUNT = rROWCOUNT+1
WEND
if rROWCOUNT = 0 then
response.write "<tr>"
response.write "<td colspan=""3"" align=""center"">"
response.write "<br><br>很抱歉,您查找的没有。<br>"
response.write "</td>"
response.write "</tr>"
end if
%>
<tr>
<td> </td>
<td colspan="4" align="right"><form name="form1" method="post" action="magazlinelib.html?a=1<%=searchStr%>#magas" onSubmit="return chk_form_msg(this)">
<%
if rROWCOUNT > 0 then
response.write "总供搜索到 <font color=""#FF9900"">" & RS_maga.recordcount & "</font>"
response.write " 个资料 共 <font color=""#FF9900"">" & RS_maga.PAGECOUNT & "</font> 页 第 <font color=""#FF9900"">"
response.write rpage & "</font> 页 "
IF rpage > 1 THEN
response.write "<a href=""/magazlinelib_search.html?rpage="
response.write "1" & searchStr & "#magas"
response.write """>"
response.write "<img src=""/images/first.gif"" alt=""第一页"" border=""0"">"
response.write "</a>"
response.write "<a href=""/magazlinelib_search.html?rpage="
response.write cstr(rpage-1) & searchStr & "#magas"
response.write """>"
response.write "<img src=""/images/previous.gif"" alt=""上一页"" border=""0"">"
response.write "</a>"
else
response.write "<img src=""/images/first.gif"" alt=""第一页"" border=""0"">"
response.write "<img src=""/images/previous.gif"" alt=""上一页"" border=""0"">"
end if
response.write " "
IF rpage < rs_maga.PAGECOUNT THEN
response.write "<a href=""/magazlinelib_search.html?rpage="
response.write cstr(rpage+1) & searchStr & "#magas"
response.write """>"
response.write "<img src=""/images/next.gif"" alt=""下一页"" border=""0"">"
response.write "</a>"
response.write "<a href=""/magazlinelib_search.html?rpage="
response.write rs_maga.PAGECOUNT & searchStr & "#magas"
response.write """>"
response.write "<img src=""/images/last.gif"" alt=""最后一页"" border=""0"">"
response.write "</a>"
else
response.write "<img src=""/images/next.gif"" alt=""下一页"" border=""0"">"
response.write "<img src=""/images/last.gif"" alt=""最后一页"" border=""0"">"
end if
response.write "<input type=""text"" name=""rpage"" size=""3"">"
response.write "<input type=""image"" src=""/images/submit.gif"" width=""22"" height=""23"" alt=""跳转至"">"
end if
%>
</form>
问题就是搜索结果到是搜索出来了,但在我点下一页的时候,不是搜索出来的数据,是数据库全部的数据。比方说,我搜的工字,结果出来了139个资料,15个页面,点下一页的时候,就是搜索5900个资料,这是全部数据库的信息。。麻烦看看