我的这段搜索模块的分页代码为什么只能显示不能分页请哪位高手帮我看一下,急用谢谢。
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="../CSS/Style.css" rel="stylesheet" type="text/css">
<title>无标题文档</title>
</head>
<body>
<%
dim Conn,RS,sqlStr,PageSize,RowCount,TotalPages,PageNo,Position,PageBegin,PageEnd
uname=request.Form("uname")
set Conn= Server.CreateObject("ADODB.Connection")
set RS = Server.CreateObject("ADODB.RecordSet")
Conn.open "provider=sqloledb;data source=(local);uid=sa;pwd=;database=datat"
sqlStr="select * from indext where huowu='"&uname&"' or jine='"&uname&"' or jiezhang='"&uname&"' or jiansuo='"&uname&"' order by mid"
RS.open sqlStr,Conn,1,1
PageSize=2
If RS.RecordCount=0 then
%>
<TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=1 style='font-size:9pt' align="center"
bgcolor="#D7DEF8">
<tr bgcolor="#FFFFFF">
<td width="5%" height="22" align="center">编号</td>
<td width="8%" align="center">货物类型</td>
<td width="8%" align="center">验货方</td>
<td width="8%" align="center">金额</td>
<td width="8%" align="center">货物状态</td>
<td width="15%" align="center">发货日期</td>
<td width="15%" align="center">到货日期</td>
<td width="8%" align="center">结帐</td>
<td width="10%" align="center">检索员</td>
</tr>
<TR height=20px>
<TD align=center colspan="11">没有任何信息!</TD>
<TR>
</TABLE>
<%
else
RS.PageSize = Cint(PageSize)
TotalPages=RS.PageCount
PageNo=Request.QueryString("PageNo")
if PageNo="" or PageNo<1 Then
PageNo = 1
end if
RS.AbsolutePage = PageNo
Position=RS.PageSize*PageNo
PageBegin=Position-RS.PageSize+1
if Position <RS.RecordCount then
PageEnd=Position
else
PageEnd= RS.RecordCount
end if
%>
<fieldset style="padding: 5">
<TABLE WIDTH=100% BORDER=0 CELLPADDING=1 CELLSPACING=1 style='font-size:9pt' align="center">
<TR>
<TD colspan="11" align="left">
<%
Response.Write "当前页号:"& PageNo &" / "& TotalPages &" | 记录:"& PageBegin & " - " & PageEnd & " / " &RS.RecordCount
%>
</TD>
<TD align=right>
</TD>
</TR>
<TR
bgcolor="#D7DEF8">
<td width="5%" align="center">编号</td>
<td width="8%" align="center">货物类型</td>
<td width="8%" align="center">验货方</td>
<td width="8%" align="center">金额</td>
<td width="8%" align="center">货物状态</td>
<td width="15%" align="center">发货日期</td>
<td width="15%" align="center">到货日期</td>
<td width="8%" align="center">结帐</td>
<td width="10%" align="center">检索员</td>
<%
RowCount = RS.PageSize
dim color1,color2
color1="#dddddd"
color2="#eeeeee"
Do While Not RS.EOF and RowCount > 0
Response.Write "<TR height=20px bgcolor="
%>
<%
if RowCount mod 2=0 then:response.write color1 else:response.write color2
%>
<%
Response.Write ">"
%>
<td width="6%" align="center"><%=rs("mid")%></td>
<td width="10%" align="center"><%=rs("huowu")%></a></td>
<td width="10%" align="center"><%=rs("yanhuo")%></td>
<td width="8%" align="center"><%=rs("jine")%></td>
<td width="8%" align="center"><%=rs("zhuangtai")%></td>
<td width="15%" align="center"><%=rs("fahuo")%></td>
<td width="15%" align="center"><%=rs("daohuo")%></td>
<td width="8%" align="center"><%=rs("jiezhang")%></td>
<td width="10%" align="center"><%=rs("jiansuo")%></td>
</tr>
<%
RowCount = RowCount - 1
RS.MoveNext
Loop
Conn.Close
set RS = nothing
set Conn = nothing
%>
<TR>
<TD colspan="11" align="center">
<%
if PageNo > 1 Then
response.write "<a href=iit.asp?PageNo=1>首页</a> <a href=iit.asp?PageNo=" & (PageNo-1) & ">上页</a> "
end if
%>
<%
For i=1 to TotalPages
if CInt(PageNo) = CInt(i) then
response.write "["&i&"]"
else
response.write " <a href=iit.asp?PageNo="&i&">"&i&"</a> "
end if
Next
%>
<%
if
TotalPages>1 and
cint(PageNo) <> cint(TotalPages) then
response.write "<a href=iit.asp?PageNo=" & (PageNo+1) & ">下页</a> <a href=iit.asp?PageNo=" & TotalPages & ">末页</a> "
end if
%>
</TD>
</TR>
</TABLE>
</fieldset>
</td>
</tr>
</table>
<%
End if
%>
</body>
</html>