[求助]多条件组合查询SQL有语法错误
我的代码如下:<%
Dim result__MM_xmmc
result__MM_xmmc = "%"
if (Request.QueryString("xmmc") <> "") then result__MM_name = Request.QueryString("xmmc")
%>
<%
Dim result__MM_sjh
result__MM_sjh = "%"
if (Request.QueryString("sjh") <> "") then result__MM_Author = Request.QueryString("sjh")
%>
<%
Dim result__MM_xkz
result__MM_Date = "%"
if (Request.QueryString("xkz") <> "") then result__MM_Date = Request.QueryString("xkz")
%>
<%
Dim result__MM_jine1
result__MM_Price1 = "1"
if (Request.QueryString("jine1") <> "") then result__MM_Price1 = Request.QueryString("jine1")
%>
<%
Dim result__MM_jine2
result__MM_Price2 = "9999"
if (Request.QueryString("jine2") <> "") then result__MM_Price2 = Request.QueryString("jine2")
%>
<%
Dim result__MM_zrfs
result__MM_Quality = "%"
if (Request.QueryString("zrfs") <> "") then result__MM_Quality = Request.QueryString("zrfs")
%>
<%
Dim result__MM_sqr
result__MM_Summary = "%"
if (Request.QueryString("sqr") <> "") then result__MM_Summary = Request.QueryString("sqr")
%>
<%
Dim result__MM_srr
result__MM_Sort = "%"
if (Request.QueryString("srr") <> "") then result__MM_Sort = Request.QueryString("srr")
%>
<%
Dim result__MM_sort
result__MM_Sort = "ID"
if (Request.QueryString("sort") <> "") then result__MM_Sort = Request.QueryString("sort")
%>
<%
Dim result__MM_mianji1
result__MM_Price1 = "1"
if (Request.QueryString("mianji1") <> "") then result__MM_Price1 = Request.QueryString("mianji1")
%>
<%
Dim result__MM_mianji2
result__MM_Price2 = "9999"
if (Request.QueryString("mianji2") <> "") then result__MM_Price2 = Request.QueryString("mianji2")
%>
<%
Dim result__MM_Array
result__MM_Array = "DESC"
if (Request.QueryString("array") <> "") then result__MM_Array = Request.QueryString("array")
%>
<%
Dim rs
Dim rs_cmd
Dim rs_numRows
Set rs_cmd = Server.CreateObject (")
rs_cmd.ActiveConnection = MM_conn_STRING
rs_ = "SELECT * FROM dbo.jianzheng WHERE xmmc LIKE '%" + Replace(result__MM_xmmc, "'", "''") + "%' AND sjh LIKE '%" + Replace(result__MM_sjh, "'", "''") + "%' AND xkz LIKE '" + Replace(result__MM_xkz, "'", "''") + "' AND " + Replace(result__MM_jine1, "'", "''") + " < jine AND jine < " + Replace(result__MM_jine2, "'", "''") + "' AND " + Replace(result__MM_mianji1, "'", "''") + " < mianji AND mianji < " + Replace(result__MM_mianji2, "'", "''") + " AND zrfs LIKE '" + Replace(result__MM_zrfs, "'", "''") + "' AND sqr LIKE '%" + Replace(result__MM_sqr, "'", "''")+ "' AND srr LIKE '%" + Replace(result__MM_srr, "'", "''") + "%' ORDER BY " + Replace(result__MM_Sort, "'", "''") + " " + Replace(result__MM_Array, "'", "''") + ""
rs_cmd.Prepared = true
rs_cmd.Parameters.Append rs_cmd.CreateParameter("param1", 200, 1, 50, rs__MMColParam) ' adVarChar
Set rs = rs_cmd.Execute
rs_numRows = 0
%>
结果错误:
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]第 1 行: '<' 附近有语法错误。
/search_finish.asp,行 74 (红色部分)
麻烦高手给看下,谢谢!