| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 429 人关注过本帖
标题:asp分页问题,请高手帮忙
只看楼主 加入收藏
tiexuedaming
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2011-4-15
结帖率:100%
收藏
 问题点数:0 回复次数:2 
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">&nbsp;共<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>&nbsp;"
Response.write "<a href=""?id="&request.QueryString("id")&"&PageNo="&PageNo-1&""">上页</a>&nbsp;"
Else
Response.write "首页&nbsp;"
Response.write "上页&nbsp;"
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>&nbsp;"
Response.write "<a href=""?id="&request.QueryString("id")&"&PageNo="&PCount&""">尾页</a>"
Else
Response.write "下页&nbsp;"
Response.write "尾页"
End if
%>
</td>
<%   Rs.close
        set rs=nothing
%>
<%Call ConnClose()
%>
搜索更多相关主题的帖子: 个人资料 数据库 style 会员 照片 
2011-04-16 10:28
scanhack
Rank: 2
等 级:论坛游民
帖 子:8
专家分:10
注 册:2011-4-13
收藏
得分:0 
默认为10条吧!可以改3条啊!
图片附件: 游客没有浏览图片的权限,请 登录注册
图片附件: 游客没有浏览图片的权限,请 登录注册

新人Microsoft Visual C++  6.0学习C语言
2011-04-16 11:02
tiexuedaming
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2011-4-15
收藏
得分:0 
哦,这个怎么用,我没用过,我试试
2011-04-16 11:11
快速回复:asp分页问题,请高手帮忙
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028628 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved