以下是search.asp代码:
----------------------以下是searchlist.asp代码
<%dim aa,bb,cc,dd,ee
aa=trim(request("year"))
bb=trim(request("month"))
cc=request("gong")
dd=request("ji")
ee=request("finish")
set rs=server.createobject("adodb.recordset")
sql = "select * from book where year='"&aa&"' and month='"&bb&"'"
if cc<>"" then
sql =sql&"and gwhere='"&cc&"'"
end if
if dd<>"" then
sql =sql&"and machine='"&dd&"'"
end if
if ee<>"" then
sql =sql&"and finish='"&ee&"'"
end if
sql = sql&"order by id desc"
rs.open sql,conn,1,1
'----------------分页
dim MaxPerPage
MaxPerPage=15
dim text,checkpage
text="0123456789"
Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next
If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if
%>
<%
Response.write "-> 全部-"
Response.write "共" & "" & Cstr(Rs.RecordCount) & "" & "条记录 "
Response.write "第" & "" & Cstr(CurrentPage) & "" & "/" & Cstr(rs.pagecount) & " "
If currentpage > 1 Then
response.write "首页 "
Response.write "上一页 "
Else
Response.write "上一页 "
End if
If currentpage < Rs.PageCount Then
Response.write "下一页 "
Response.write "尾页 "
Else
Response.write ""
Response.write "下一页 "
End if
%>
以上在search.asp中点查询可以在searchlist.asp页面正常查出所需信息,但点击下一页或上一页时cc、dd、ee的参数传递不过去,它返回了数据库所有信息,请版主指教哪里出错,如何修改,谢谢。
|