条件“或”的查询问题!!!

davidsun1004 2003-12-10 06:17:22
我的程序要查询关于姚明,王治郅或巴特尔的相关信息,但查找结果是全部的tit信息,向各位行家请教!!


<%
on error resume next
Set conn = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("database/NEW123.MDB")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
SET Rs = Server.CreateObject("ADODB.Recordset")

%>
<% Rs.open "Select * from article Where tit like '%姚明%' or '%王治郅%' or '%巴特尔%' ",conn,3,1
if not rs.eof then
%>
<%
do while not Rs.eof
%><img src="images/b.gif" width="18" height="18"><a href="article_view.asp?id=<%=rs("id")%>">
<%= Rs("tit") %></a>(<%= Rs("date") %>)<br>

<%
Rs.movenext
loop
end if
rs.close
set rs=noting
conn.close
set conn=nothing
%>
...全文
28 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
davidsun1004 2003-12-10
  • 打赏
  • 举报
回复
谢谢!!
看来要多想大家学习!
好好学习,天天向上!!
PlentySoft 2003-12-10
  • 打赏
  • 举报
回复
Select * from article Where tit like '%姚明%' or tit like '%王治郅%' or tit like '%巴特尔%'

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧