多条件搜索后第一页显示正常,点下一页就变成全部记录了,请大侠出手!
源代码如下:<table id="__01" border="0" cellpadding="0" cellspacing="0" align=center>
<tr>
<td width="44" height="112">
<img src="stimg/main1_01.gif"></td>
<td width="202" height="112">
<img src="stimg/main1_02.gif"></td>
<td width="24" height="112">
<img src="stimg/main1_03.gif"></td>
<td width="632" height="112" >
<img src="stimg/main1_04.gif" ></td>
<td width="48" height="112" >
<img src="stimg/main1_05.gif" ></td>
</tr>
<tr>
<td width="44" height="40" valign="top">
<img src="stimg/main1_06.gif"></td>
<td width="202" height="40" valign="top">
<img src="stimg/main1_07.gif" ></td>
<td width="24" height="40" valign="top">
<img src="stimg/main1_08.gif" ></td>
<td width="632" height="40" valign="top">
<img src="stimg/main1_09.gif" ></td>
<td width="48" height="40" valign="top">
<img src="stimg/main1_10.gif" ></td>
</tr>
<tr>
<td width="44" height="608" valign="top">
<img src="stimg/main1_11.gif" ></td>
<td width="202" height="608" valign="top"><table width="202" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="202" height="461">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.,0,19,0" width="202" height="458">
<param name="movie" value="main.swf">
<param name="quality" value="high">
<embed src="main.swf" quality="high" pluginspage="http://www. type="application/x-shockwave-flash" width="202" height="458"></embed>
</object>
</td>
</tr>
<tr>
<td width="202" height="147"><img src="stimg/13.gif"></td>
</tr>
</table></td>
<td width="24" height="608" valign="top">
<img src="stimg/main1_13.gif"></td>
<%
dim name,sex,xk,lwname,lwjb,lwtime,lwzz,lwbz,updatetime,ip,rs,db
name=trim(request.form("name"))
sex=trim(request.form("sex"))
xk=trim(request.form("xk"))
lwname=trim(request.form("lwname"))
lwjb=trim(request.form("lwjb"))
lwtime=trim(request.form("lwtime"))
lwzz=trim(request.form("lwzz"))
lwbz=trim(request.form("lwbz"))
%>
<td width="632" height="600" valign="top">
<%
MyPageSize = 4 '每页显示多少文章
If Not IsNumeric(Request("page")) Or IsEmpty(Request("page")) Or Request("page") <=0 Then
MyPage=1
Else
MyPage=Int(Abs(Request("page")))
End if
%>
<%
db="2010xzxxhjdj.asp" '数据库文件的位置
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
conn.Open connstr
set rs=server.createobject("adodb.recordset")
strSql = "select * from tlw where 1=1 "
If name <> "" then
strSql = strSql & " and name like '%" & name & "%'"
end if
if sex <> "" then
strsql = strsql & " and sex like '%" & sex & "%'"
end if
if xk<> "" then
strSql = strSql & " and xk like '%" & xk & "%'"
end if
if lwjb<> "" then
strSql = strSql & " and lwjb like '%" & lwjb & "%'"
end if
if lwbz<> "" then
strSql = strSql & " and lwbz like '%" & lwbz & "%'"
end if
if lwtime<> "" then
strSql = strSql & " and lwtime like '%" & lwtime & "%'"
end if
rs.open strsql,conn,1,1
if not rs.eof then
rs.PageSize = MyPageSize
MaxPages = rs.PageCount
rs.absolutepage = MyPage
total = rs.RecordCount
for i=1 to rs.PageSize
if not rs.eof then
%>
<table align=center border=1 width=622 id="listView">
<tr><th colspan="6">成果信息</th></tr>
<tr>
<td width="102" >姓 名</td>
<td width="101" ><%=rs("name")%></td>
<td width="90" >性 别</td>
<td width="80" ><%=rs("sex")%></td>
<td width="90" >获奖分类</td>
<td width="109" ><%=rs("xk")%></td>
</tr>
<tr>
<td width="102" >获奖名称</td>
<td colspan=3 width="220" ><%=rs("lwname")%></td>
<td width="90" >获奖级别</td>
<td width="109" ><%=rs("lwjb")%></td>
</tr>
<tr>
<td width="90" >组织单位</td>
<td colspan=3 width="220" ><%=rs("lwzz")%></td>
<td width="108" >获得成果时间</td>
<td width="101" ><%=rs("lwtime")%></td>
</tr>
<tr>
<td width="102" >成果备注</td>
<td colspan=5 width="250" ><%=rs("lwbz")%></td>
</tr>
</table>
<%
rs.movenext
end if
next
else
response.write "对不起,没有符合要求的成果信息记录"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<table align=center border=1 bordercolor="#67C1E4" width=622>
<%
url="?"
dim n, i,strTemp
if total mod MyPageSize=0 then
n= total \ MyPageSize
else
n= total \ MyPageSize+1
end if
strTemp= "<tr><td align='center' class=black colspan=5>"
strTemp=strTemp & "共<b>"&total&"</b>名 "
if MyPage<2 then
strTemp=strTemp & "首页 上页 "
else
strTemp=strTemp & "<a href='"&Url& "page=1'>首页</a> "
strTemp=strTemp & "<a href='"&Url& "page="&(MyPage-1)&"'>上页</a> "
end if
if n-MyPage<1 then
strTemp=strTemp & "下页 尾页"
else
strTemp=strTemp & "<a href='"&Url& "page="&(MyPage+1)&"'>下页</a> "
strTemp=strTemp & "<a href='"&Url& "page="&n& "'>尾页</a>"
end if
strTemp=strTemp & " 页次:<strong><font color=red>"&MyPage&"</font>/"&n&"</strong>页"
strTemp=strTemp & "<b>"&MyPageSize&"</b> 名/页"
strTemp=strTemp & "转到:<select name='page' size='1' onChange=""javascript:window.location='"&Url& "page=" & "'+this.options[this.selectedIndex].value;"" class='input'>"
for i = 1 to n
strTemp=strTemp & "<option value='"&i&"'"
if cint(MyPage)=cint(i) then strTemp=strTemp & " selected "
strTemp=strTemp & ">第" & i & "页</option>"
next
strTemp=strTemp & "</select>"
strTemp=strTemp & "</td></tr>"
response.write strTemp
%>
</table> </td>
<td width="48" height="608" valign="top"><img src="stimg/main1_15.gif"></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" align=center valign=top>
<tr>
<td width="44" height="110" >
<img src="stimg/main1_16.gif"></td>
<td width="202" height="110" >
<img src="stimg/main1_17.gif"></td>
<td width="24" height="110">
<img src="stimg/main1_18.gif"></td>
<td width="632" height="110">
<img src="stimg/main1_19.gif"></td>
<td width="48" height="110" >
<img src="stimg/main1_20.gif" ></td>
</tr>
</table>
</body>
</html>