ASP网页出错0x80040E37, 求救

来源:百度知道 编辑:UC知道 时间:2024/09/25 22:23:45
麻烦高手帮我看看吧, 不断出错. 多谢了!!
<%
dim conn,mdb,connstr
mdb=server.mappath("list.mdb")
connstr="DRIVER=Microsoft Access Driver (*.mdb);DBQ="&mdb
set conn=server.createobject("adodb.connection")
conn.open connstr

sql="select * from list where Name like '%'&'"&keyword&"'&'%'"

Set rs=conn.execute(sql) <<--- 提示这一行出错
total=rs.recordcount
%>

<p><font size="3">你查询的是</font>:<font color="0000ff"><%=keyword%></font></p>

<%
If rs.eof and rs.bof Then
response.write "对不起,没有找到您要找的资料,请输入其它关键词重新查找!"
End If
%>
<table width="75%" border="0">
<% while not rs.eof %>
<tr bgcolor="#FFFFCC">
<td><font color="#000066" size="2&

仅当使用 Microsoft® Jet 4.X 版和 Microsoft OLE DB Provider for Jet 时,ANSI SQL 通配符 (%) 和 (_) 才可用。若使用 Microsoft Access 或 DAO,则将其视为原义字符。
sql="select * from list where Name like '%"&keyword&"%'"

sql="select * from list where Name like '%"&keyword&"%'"

sql="select * from list where Name like '%%" & keyword & "%%'"

这样试试看

sql=\"select * from list where Name like \'%\"&keyword&\"%\'\"

再试试这个...

sql="select * from list where Name like '%"&keyword&"%'"