向高手致敬!关于查询结果循环问题(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")
%>