各位大虾,我是新手,请帮帮我吧。好几天了,怎么就弄不明白。
请你们看看我下边的代码问题处在什么地方,按“确定”按钮能按查询条件进行查询,但按“下一页”时查询的是所有数据,不知怎么回事,请指点,谢谢!!
由于一次发不下,我分几页分发。请给我看看。
<html>
<body topmargin="0" leftmargin="0">
<%
sequipmentname=Request.form("EquipmentNameEdit")
sequipmentname=replace(sequipmentname,"'","''")
sspec=request("SpecEdit")
sspec=replace(sspec,"'","''")
smodel=request("ModelEdit")
smodel=replace(smodel,"'","''")
sTechnicstatus=request("TechnicstatusEdit")
sTechnicstatus=replace(sTechnicstatus,"'","''")
sLeavePlace=request("LeavePlaceEdit")
sLeavePlace=replace(sLeavePlace,"'","''")
sUseUnit=request("UseUnitEdit")
sUseUnit=replace(sUseUnit,"'","''")
PageShowSize = 10 '每页显示多少个页
MyPageSize = 15 '每页显示多少条新闻
if Not IsNumeric(Request("page")) Or IsEmpty(Request("page")) Or Request("page") <=0 Then
MyPage=1
Else
MyPage=Int(Abs(Request("page")))
End if
sqlstr="select * from DeviceDeskBookMtbl where ifunused=1 "
if sequipmentname<>"" then
sqlstr=sqlstr+" and Devicename like '%"& sequipmentname &"%' "
end if
if sspec<>"" then
sqlstr=sqlstr+" and spec like '%"& sspec &"%' "
end if
if smodel<>"" then
sqlstr=sqlstr+" and Type like '%"& smodel &"%' "
end if
if sTechnicstatus<>"" then
sqlstr=sqlstr+" and Techstatus like '%"& sTechnicstatus &"%' "
end if
if sLeavePlace<>"" then
sqlstr=sqlstr+" and BeLongBuild like '%"& sLeavePlace &"%' "
end if
if sUseUnit<>"" then
sqlstr=sqlstr+" and useunit like '%"& sUseUnit &"%' "
end if
set rs=server.createobject("adodb.recordset")
rs.source=sqlstr
rs.Open rs.Source,conn,1,1
If Not rs.eof then
rs.PageSize = MyPageSize
MaxPages = rs.PageCount
rs.absolutepage = MyPage
total = rs.RecordCount
end if
%>