<%
dim pname
pname=request("search1")
If Trim(pname)="" Then
Response.Write"<script>alert('Input Character');history.go(-1);</script>"
Response.End()
End If
Set Rs=Server.CreateObject("Adodb.Recordset")
Str=Split(pname,",")
For i=0 to Ubound(Str)
StrTemp=Str(i)
Sql=Sql&" or proname like '%"&StrTemp&"%'"
Next
sql="Select * From mbcomp Where proname like '%"&Str(0)&"%'"&Sql&""
if not (rs.eof and rs.bof) then
Rs.Open sql,dbconn,1,1
Response.write"<table width='760' border='0' cellspacing='1' cellpadding='2' class='tbbgcolor'>"
Response.write"<tr >"
Response.write"<td class='trbgcolor_1'>Product Name</td>"
Do while not Rs.eof
Response.write" <tr>"
Response.write" <td class='trbgcolor_2'><a href='motherboard_view.asp?productid="&Rs("proid")&"'>"&Rs("proname")&"</a></td>"
Response.write" <td><font color='#ff0000'>查询到记录</font></td></tr>"
Rs.movenext
loop
Rs.movefirst
Response.write"</table>"
end if
Rs.close : Set Rs=Nothing
%>作者: 酷aiq兒kuku 时间: 2010-1-9 07:04
先将你的SQL打印出来看看,估计是SQL语句问题。作者: 左手的云 时间: 2010-1-9 07:04
请问我怎么打出来.我代码都全部给出来了.那个"未查询到记录"的代码我没有.就是想实现这个功能.我应该怎么去改写我的代码.作者: n煲 时间: 2010-3-1 21:05
楼主强呀,这样贴子也能发表出来,对你佩服之心比长江的水还多哦