代码如下:
 
<%
s1=request("s1")
s3=request("s3")
s4=request("s4")
  
if s1 ="" and s3 = "" and s4 = ""then
sql="select * from redbook "
else
sql="select * from redbook where (xl-name like '%"&s1&"%' or xl-xs like '%"&s3&"%' or xl-sec like '%"&s4&"%') and language="&language&" order by id"
end if
rs.open sql,conn,1,1
%>
s1,s2,s3分别是3个输入框
xl-name属性 全是中文
xl-xs属性 是数字,不过有些有带 +
xl-sec属性 是数字,不过有些有带 + *不输入条件到s1,s2,s3的话SQL能输出所有数据,可是输入条件后,系统就提示错误,
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21' ODBC 驱动程序不支持所需的属性。 哪位高手帮帮忙!

解决方案 »

  1.   

    xl-name -> [xl-name]
    xl-xs  ->  [xl-xs] 
    xl-sec -> [xl-sec]--把三個列名改改試試
      

  2.   

    --trysql="select * from redbook where ([xl-name] like '%"&s1&"%' or [xl-xs] like '%"&s3&"%' or [xl-sec] like '%"&s4&"%') and language="&language&" order by id"
      

  3.   

    应该不只是列名的问题吧如果只是列名的问题应该提示列名 'xl' 无效。
    列名 'name' 无效。因为sql会把"-"认为是减号
      

  4.   

    楼主xl-name属性 全是中文是什么意思?xl-name是列名马?
      

  5.   

    xl-name属性 全是中文
    xl-xs属性 是数字,不过有些有带 +
    xl-sec属性 是数字,不过有些有带 + *意思是
    xl-name属性里面的数据全是中文字组成
    xl-xs属性里面的数据是数字组成,不过有些有带 +
    xl-sec属性里面的数据是数字组成,不过有些有带 + *