标题:向高手致敬!关于查询结果循环问题(asp问题)
取消只看楼主
xiaodpp
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2013-10-28
结帖率:0
已结贴  问题点数:20 回复次数:0 
向高手致敬!关于查询结果循环问题(asp问题)
下面是源代码,在多重条件下,有几个条件有问题,一旦选择了,就跳出("对不起,没有您查询条件的会员~!")。问题是在access数据库中有这样的,不知道是什么原因。这几个不正常的是:P_JuZhuDi_Area、P_JuZhuDi_City、P_XueLi、P_Hyzk、XingZuo
让高手们看看,问题在哪里!在这里谢谢大家了!



<!--查询结果循环开始-->

<%
                Dim Action,strWhere,strOrderby
                Dim Sex,minAge,maxAge,P_JuZhuDi_Area,P_JuZhuDi_City,P_Answer1,P_Photo,minHeight,maxHeight,P_XueLi,P_Hyzk,P_MinZu,P_ZongJiao,P_XueXing,P_XingZuo
                Dim ac,bc
                Action=Trim(request("submitok"))
                Sex=Trim(request("sex"))
                minAge=Trim(request("minAge"))
                maxAge=Trim(request("maxAge"))
                P_JuZhuDi_Area=Trim(request("P_JuZhuDi_Area"))
                P_JuZhuDi_City=Trim(request("P_JuZhuDi_City"))
                P_Answer1=Trim(request("LoveType"))
                P_Photo=Trim(request("photo"))
                minHeight=Trim(request("minHeight"))
                maxHeight=Trim(request("maxHeight"))
                P_XueLi=Trim(request("minEducation"))
                P_Hyzk=Trim(request("marrigeStatus"))
                P_MinZu=Trim(request("nationality"))
                P_ZongJiao=Trim(request("religion"))
                P_XueXing=Trim(request("bloodType"))
                P_XingZuo=Trim(request("astrology"))


                If Action="ok" Then
                    strWhere=" And P_CeShi=-1 And P_PingBi=0"
                    If IsNumeric(Sex) Then strWhere = strWhere &" and P_Sex=" & CInt(Sex)
                    Ac=    Year(Now())-Int(minAge)
                    Bc=Year(Now())-Int(maxAge)
                    strWhere = strWhere &" And Year(P_BirthdayTime) BETWEEN "&Bc&" And "&Ac
                    If P_JuZhuDi_Area<>"" Then strWhere = strWhere &" And P_JuZhuDi_Area=" & P_JuZhuDi_Area
                    If P_JuZhuDi_City<>"" Then strWhere = strWhere &" And P_JuZhuDi_City=" & P_JuZhuDi_City
                    If P_Answer1<>0  Then strWhere = strWhere &" And P_Answer1="&P_Answer1
                    If P_Photo="yes" Then strWhere = strWhere & " and P_Photo<>''"
                    If CInt(minHeight) < CInt(maxHeight) Then strWhere = strWhere & " and P_ShenGao <= " & CInt(maxHeight) & " and P_ShenGao >= "&CInt(minHeight)
                    If CInt(P_XueLi)>0 Then strWhere = strWhere & " and P_XueLi="&minEducation
                    If CInt(P_Hyzk)>0 Then strWhere = strWhere & " and P_Hyzk="&marrigeStatus
                    If CInt(P_MinZu)>0 Then strWhere = strWhere & " and P_MinZu="&P_MinZu
                    If CInt(P_ZongJiao)>0 Then strWhere = strWhere & " and P_ZongJiao="&P_ZongJiao
                    If CInt(P_XueXing)>0 Then strWhere = strWhere & " and P_XueXing="&P_XueXing
                    If CInt(P_XingZuo)>0 Then strWhere = strWhere & " and P_XingZuo="&P_XingZuo
                Else
                    strWhere=" And P_CeShi=-1 And P_PingBi=0"
                End If

                Dim order     :    order=CInt(Request("order"))
                Select Case order
                Case 2
                    strOrderby= " order by P_ChengXin desc"
                Case 3
                    strOrderby= " order by P_JiBie desc"
                Case Else
                    strOrderby= " order by P_AddDate desc"
                End Select


               
                Sql="Select * From HH_User where 1=1" & strWhere & strOrderby

                    set rs=Server.CreateObject("ADODB.recordset")
                    rs.open sql,conn,1,1
                    'all_num=rs.recordcount
                    IF  Rs.BOF=True And Rs.EOF =True Then   
                        call msg("对不起,没有您查询条件的会员~!","-1")
                    Else
                         dim page,ipage
                          rs.pagesize=5
                          page=request("Page")
                          pages(page)
                          page=clng(Page)
                          if page > rs.pagecount then response.redirect "./"
                          if page=empty then page=1
                          rs.absolutepage=page
                          for ipage=1 to rs.pagesize
                          dim YangShi_Vip,Vip_jibie
                          Vip_jibie=rs("P_Jibie")
                          YangShi_Vip="class=Aqss_liebiao"
                          Select case Vip_jibie
                              case 0:YangShi_Vip="class=Aqss_liebiao"
                              case 1:YangShi_Vip="class=Aqss_liebiao_vip"
                              case 2:YangShi_Vip="class=Aqss_liebiao_vipcheng"
                          End select
                                '判断诚信任
                          P_ChengXin=rs("P_ChengXin")
                    %>
搜索更多相关主题的帖子: 源代码 access 数据库 会员 
2013-10-28 15:39



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-422654-1-1.html




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

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