谁能帮我看看,这段代码哪里不对了。
出错显示:
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC Microsoft Access Driver] 标准表达式中数据类型不匹配。
<%
        
        sql="select user.* from user,user_info where user.user_name like '%' and user.user_name=user_info.user_name"
        if sex<>"无特别要求" then
            sql=sql&" and sex='"&sex&"'"
        end if
        if married<>"无特别要求" then
            sql=sql&" and married='"&married&"'"
        end if
        if relation<>"无特别要求" then
            sql=sql&" and relation='"&relation&"'"
        end if
        if province<>"无特别要求" then
            sql=sql&" and work_province='"&province&"'"
        end if
    '///////////////////////////
    
        
        if height<>"无特别要求" and height<>"" then
            
            if height="150厘米以下" then
                sql=sql&" and height<150"
            elseif     height="150-154厘米" then
                sql=sql&" and height>=150 and height<=154"
            elseif height="155-159厘米" then
                sql=sql&" and height>=155 and height<=159"
            elseif height="160-164厘米" then
                sql=sql&" and height>=160 and height<=164"
            elseif height="165-169厘米" then
                sql=sql&" and height>=165 and height<=169"
            elseif height="170-174厘米" then
                sql=sql&" and height>=170 and height<=174"
            elseif height="175-179厘米" then
                sql=sql&" and height>=175 and height<=179"
            elseif height="180-184厘米" then
                sql=sql&" and height>=180 and height<=184"
            elseif height="185-189" then
                sql=sql&" and height>=185 and height<=189"
            elseif height="190-194厘米" then
                sql=sql&" and height>=190 and height<=194"
            elseif height="195-199厘米" then
                sql=sql&" and height>=195 and height<=199"
            elseif height="200厘米以上" then
                sql=sql&" and height>=200"
            end if
        
                
                    
        end if
        
        
        ''''''''''''''''
        temp=year(date)
        if age="1" then
            byear=temp-18
            sql=sql&" and byear>'"&byear&"'"
        elseif age="2" then
            sql=sql&" and byear<'"&temp-18&"'"
            sql=sql&" and byear>'"&temp-25&"'"
        elseif age="3" then
            sql=sql&" and byear<'"&temp-24&"'"
            sql=sql&" and byear>'"&temp-31&"'"
        elseif age="4" then
            sql=sql&" and byear<'"&temp-30&"'"
            sql=sql&" and byear>'"&temp-41&"'"
        elseif age="5" then
            sql=sql&" and byear<'"&temp-40&"'"
        end if
'///////////////////////////
        if education="1" then
            sql=sql&" and education='初中'"
        elseif education="2" then
            sql=sql&" and education in('高中','专科','本科','硕士','博士')"
        elseif education="3" then
            sql=sql&" and education in('专科','本科','硕士','博士')"
        elseif education="4" then
            sql=sql&" and education in('本科','硕士','博士')"
        elseif education="5" then
            sql=sql&" and education in('硕士','博士')"
        elseif education="6" then
            sql=sql&" and education='博士'"
        end if
'////////////////////////////////        
    
        if salary<>"无特别要求" then
            sql=sql&" and salary='"&salary&"'"
        
            
        end if
    
'////////////////////////////////////////         
          set rs3=server.CreateObject ("ADODB.recordset")
       rs3.Open sql,conn1,3
        'Response.Write "<P>"&sql&"</P>"
        'Response.End
%>
 
[此贴子已经被作者于2006-8-27 13:04:49编辑过]

 
											





 
	    

