注册 登录
编程论坛 ASP技术论坛

模糊搜索问题

linjirongll 发布于 2008-04-15 22:10, 640 次点击
高手帮忙看下,为什么这样的模糊多表搜索,会提示没有RS"title"记录的啊?我的数据库里明明的这个记录的啊,
       <% key=request.Form("shousuo")
    Set conn=server.CreateObject("adodb.connection")
    crt="provider=Microsoft.JET.OLEDB.4.0;Data Source="&Server.MapPath("shuju.mdb")
    conn.open crt
    set rs=server.createobject("adodb.recordset")
    rs.open"select new.* ,new2.* ,new3.* from new,new2,new3 where new.title like '%"&key&"%' or new2.title like '%"&key&"%' or new3.title like '%"&key&"%'",conn,1,1
    do while not rs.eof%>
    <%=rs("title")%>    
    <%rs.movenext
    loop
    %>
1 回复
#2
不惑2008-04-15 23:25
原因是你的ACCESS数据中有许多特殊的字符,我以前找过,找到过5-6个特殊的字符,只要有这些字符,你的模糊查找就不能实现。方法一、找到这些字符,把它用其它字符替换了,比如换成全角的。
方法二、建议换一个SQL数据等。
1