asp分页问题,请高手帮忙
分页问题,数据库中有10条记录,我分别为a,b,c,d,e,f,g,h,i,j;现在出现个问题,我想每页显示3条,可是第一页出现的是全部10条,第二页出现的是d,e,f,g,h,i,j;第三页出现的是g,h,i,j;第四页出现的是j;哪儿大侠能帮一忙'显示报名会员信息,包括会员照片,个人资料
<table width="304" border="0" cellspacing="0" style="margin:2px ">
<tr>
<%'
P_Hd_Id=request.QueryString("id")
sub pic_index(P_Photo,P_UserId,P_Sex)
if P_Photo<>"" then
response.write "<img src=../Pic_Custom/"&P_UserId&"/"&P_Photo&" border=0 alt='点击查看大图片' width=98 height=118 >"
else
set rs_pic=Server.CreateObject("ADODB.recordset")
sql_pic="select P_ZhuZhaoPian from Ejz_User_Pic where P_UserId='"&P_UserId&"' and P_ShenHe=-1"
rs_pic.open sql_pic,conn,1,1
if rs_pic.recordcount<>0 then
if P_Sex="0" then
response.write "<img src=../Images/xiangce_woman.gif border=0 width=98 height=118>"
else
response.write "<img src=../Images/xiangce_man.gif border=0 width=98 height=118>"
end if
else
if P_Sex="0" then
response.write "<img src=../Images/nophoto_woman.gif border=0 width=98 height=118>"
else
response.write "<img src=../Images/nophoto_man.gif border=0 width=98 height=118>"
end if
end if
'response.write sq_pic&"相册照片"
end if
rs_pic.close
set rs_pic=nothing
end sub
sub pic_shouye(P_Photo,P_UserId,P_Sex)
if P_Photo<>"" then
response.write "<img src=../Pic_Custom/"&P_UserId&"/"&P_Photo&" border=0 alt='点击查看大图片' width=105 height=139 style='border:#565656 1px solid;'>"
else
set rs_pic=Server.CreateObject("ADODB.recordset")
sql_pic="select P_ZhuZhaoPian from Ejz_User_Pic where P_UserId='"&P_UserId&"' and P_ShenHe=-1"
rs_pic.open sql_pic,conn,1,1
if rs_pic.recordcount<>0 then
if P_Sex="0" then
response.write "<img src=../Images/xiangce_woman.gif border=0 width=105 height=139 style='border:#565656 1px solid;'>"
else
response.write "<img src=../Images/xiangce_man.gif border=0 width=105 height=139 style='border:#565656 1px solid;'>"
end if
else
if P_Sex="0" then
response.write "<img src=../Images/nophoto_woman.gif border=0 width=105 height=139 style='border:#565656 1px solid;'>"
else
response.write "<img src=../Images/nophoto_man.gif border=0 width=105 height=139 style='border:#565656 1px solid;'>"
end if
end if
end if
rs_pic.close
set rs_pic=nothing
end sub
'显示报名会员信息
set rsa=Server.CreateObject("ADODB.recordset")
sqla="select P_HuiYuan From Ejz_HuoDong_BaoMing where P_Hd_Id="&request.QueryString("id")&" and P_HuiYuan<>''"
'set rsa=conn.execute(sqla)
rsa.open sqla,conn,3
'response.Write(sqla)
If not rsa.eof Then
Rsa.Pagesize = 3'每页显示记录数
Psize = Rsa.PageSize
PCount = Rsa.PageCount'总页数
RCount = Rsa.RecordCount'总记录数
'response.Write(PCount)
PageNo = Cint(Request.QueryString("PageNo"))
if PageNo="" then PageNo=1
If PageNo < 1 Then
PageNo = 1
Elseif PageNo > PCount Then
PageNo = PCount
End If
'if not rsa.eof then rsa.AbsolutePage =PageNo
if not (rsa.bof and rsa.eof) then Rsa.AbsolutePage = PageNo
If not rsa.eof Then
while not rsa.eof
j=1
P_HuiYuan=rsa("P_HuiYuan")
set rsb=server.createobject("adodb.recordset")
exec="select P_Count from Ejz_HuoDong_BaoMing Where P_HuiYuan='"&P_HuiYuan&"' "
'response.Write(exec)
rsb.open exec,conn,1,1
Area=request.QueryString("P_JuZhuDi_Area")
sex=0
if Area<>"" then
sql="select * from Ejz_User where P_Photo<>'' and P_JuZhuDi_Area='"&Area&"' and P_TuiJian=1 and P_UserId='"&P_HuiYuan&" order by P_EditDate desc"
end if
if sex<>"" then
sql="select * from Ejz_User where P_Photo<>'' and P_PingBi=0 and P_sex="&sex&" and P_TuiJian=1 and P_UserId='"&P_HuiYuan&"' order by P_EditDate desc"
end if
Set Rs=conn.execute(sql)
if rs.eof and rs.bof then
Response.Write "<span style='padding:5px 50px; text-align:center; font-size:14px; color:#ff0000'><span>"
else
%>显示内容,<table>....</table>
<%
if j mod 3 =0 then
response.write"<tr></tr>"
end if
rs.movenext
if j>200 then
end if
j=j+1
end if
Rs.close
set Rs=nothing
rsa.movenext
wend
end if
rsa.close
set rsa=nothing
%>
</tr>
</table>
<%end if%>
<td width="25%" height="25"> 共<Font color="#FF0000"><%= RCount %></Font>条 分<Font color="#FF0000"><%= PCount %></Font>页
| 当前第<Font color="#FF0000"><%= PageNo %></Font>页</td>
<td width="30%" align="right">
<%
If PageNo > 1 Then
Response.write "<a href=""Index.BaoMing.asp?id="&request.QueryString("id")&""">首页</a> "
Response.write "<a href=""?id="&request.QueryString("id")&"&PageNo="&PageNo-1&""">上页</a> "
Else
Response.write "首页 "
Response.write "上页 "
End if
%>
<select name="menu2" onChange="form.submit();" style="width:40px;">
<%For i =1 to PCount
%>
<option value="?PageNo=<%= i %>&id="&request.QueryString("id")&"" <% If i = PageNo Then Response.write "Selected"%>><%=i%></option>
<% Next %>
</select>
<%
If PageNo < PCount Then
Response.write "<a href=""?id="&request.QueryString("id")&"&PageNo="&PageNo+1&""">下页</a> "
Response.write "<a href=""?id="&request.QueryString("id")&"&PageNo="&PCount&""">尾页</a>"
Else
Response.write "下页 "
Response.write "尾页"
End if
%></td>
<% Rs.close
set rs=nothing
%>
<%Call ConnClose()
%>