查询的代码:
<%
dim hotel_dq,hotel_name,hotel_qj,hotel_lx,hotel_level
hotel_dq=mfkiqpl.nosqlinject(trim(request.Form("hotel_dq")))
hotel_lx=mfkiqpl.nosqlinject(trim(request.Form("hotel_lx")))
hotel_name=mfkiqpl.nosqlinject(trim(request.Form("hotel_name")))
hotel_qj=mfkiqpl.nosqlinject(trim(request.Form("hotel_qj")))
sql="select id,hotel_name,hotel_city,hotel_level,hotel_price,hotel_price_1,hotel_photo,hotel_type,hotel_add,hotel_bio,hotel_dq from hotel where "
if hotel_dq<>"" then sql=sql&" hotel_dq='"&hotel_dq&"' "
if hotel_lx<>"" then sql=sql&" hotel_level='"&hotel_lx&"'"
if hotel_name<>"" then sql=sql&" hotel_name like '%"&hotel_name&"%' "
if hotel_qj<>"" then sql=sql&" hotel_price_1>"&hotel_qj&" "
set rs=server.CreateObject("ADODB.Recordset")
'selectsql=selectsql+1
rs.open sql,conn,1,2
%>
出现的错误:有时候全部能查出没有where的关系
有时候附近有语法错误
[此贴子已经被作者于2007-8-10 13:03:09编辑过]