asp高手帮忙看看哪儿错了

来源:百度知道 编辑:UC知道 时间:2024/06/25 06:25:51
<!--#include file="conn.asp"-->
<form name="frm_Search" method="get" action="Search.asp">
请输入关键字:
<input type="text" name="key" size="10">
<input type="submit" value="搜索">
</form>
<%
Dim S_Key,RST,StrSQL
S_Key = Trim(Request("key")) '得到搜索关键字的值
If S_Key <>"" then
Set RST=Server.CreateObject("ADODB.RecordSet")
StrSQL=AutoKey(S_Key) '此处使用自定义函数 AutoKey(),该函数为实现智能搜索的核心
RST.Open StrSQL,conn,3,2'得到搜索后的记录
If RST.BOF And RST.EOF Then
%>
<font color="#FF0000">Sorry,未找到任何结果!</font>
<%
Else
%>
搜索名称为“<font color="#FF0000"><%= S_Key %></font>”的项,共找到 <font color="#FF0000"><%= RST.RecordCount %></font> 项:<p>
<%
Whil

sql语句错了,where 后面要空格,还有about字段重复了
改为:
AutoKey="Select * from 教学课件资源 where 文件名 like '%" & strKey & "%' or & strNew1 & strNew2

AutoKey="Select * from 教学课件资源 where文件名 like '%" & strKey & "%' or about like '%" & strKey & "%'" & strNew1 & strNew2