ODBC 驱动程序不支持所需的属性
<!--#include file="conn.asp"--><%
searchstyle=request("searchstyle")
title=request("title")
sql="select a.id,a.pname,a.image,b.class,a.introduce,a.lcount from product as a left join productclass as b on a.class=b.id"
if title="" then
sql=sql&" where b.id="&searchstyle&" order by a.adddate desc"
else
sql=sql&" where b.id="&searchstyle&" and a.title like '%"&title&"%' order by a.adddate desc"
end if
rs.Open sql,conn,1,1
%>
conn.asp
<%
set conn=server.CreateObject("adodb.connection")
DBPath=server.MapPath("../../data/database.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&DBPath
set rs=server.CreateObject("adodb.recordset")
%>
总是报
ODBC 驱动程序不支持所需的属性。
\admin\product\searchok.asp, line 17
连接数据库肯定没问题,
如果title为空时 这条sql语句执行,并能查询出结果,没什么问题。
但是else后面这条sql语句就有问题了
我直接把这sql语句放数据库里用sql视图查询,总提示我
此时我是直接给它赋值的(现在在这帖子里,一句放不开,所以换行了)
select a.id,a.pname,a.image,b.class,a.introduce,a.lcount from product as a left join productclass as b on a.class=b.id where b.id=19
and a.title like '%2%' order by a.adddate desc
问题出在哪呢??不明白