| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 456 人关注过本帖
标题:[求助]我是新手 寻找ASP模糊查询程序
只看楼主 加入收藏
临风
Rank: 1
等 级:新手上路
帖 子:64
专家分:0
注 册:2006-7-5
收藏
 问题点数:0 回复次数:4 
[求助]我是新手 寻找ASP模糊查询程序
如题,做了好几个程序都不管用,如果哪位朋友有现有的程序,请给发一个,小弟不尽
搜索更多相关主题的帖子: ASP 模糊 
2006-07-05 13:27
hangxj
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:2045
专家分:0
注 册:2006-4-10
收藏
得分:0 
Select * From TableName Where FiledName Like '%"&SearchContent&"%'

http://www./
2006-07-05 13:41
临风
Rank: 1
等 级:新手上路
帖 子:64
专家分:0
注 册:2006-7-5
收藏
得分:0 

如果是查询两个关键字呢?
请看一下我的这个查询程序:
<!--#include file="conn.asp"-->
<%
set rs=server.createobject("adodb.recordset")
SQL=sql="select * from bigclass where bigclassname like '%"&bigclassname&"%' and sheng like '%"&sheng&"%'"

rs.open sql,conn,1,3
rcount=rs.recordcount
if pmcount="" or isempty(pmcount) or pmcount<1 then
pmcount=19
end if
rs.pagesize=pmcount '设置每页数
mpage=rs.pagecount '得到总页数
pageno=Request.QueryString("pageno")
if cint(pageno)<1 or cint(pageno)>mpage then
pageno=1
end if


if rs.bof and rs.eof then
response.write "<tr><td colspan='5'><div align='center'>暂时没有鸽舍加盟</div></td></tr>"
else

rs.absolutepage=pageno '将指针移至指定页的第一条记录
loopno=pmcount

do while not rs.eof and loopno>0

%>
<tr>
<td width="100%" align="left" bgcolor="#F2FFEE"><p style="line-height: 150%; margin-top: 3; margin-bottom: 3">&nbsp;<img src="images/job_dot02.gif" width="9" height="9" border="0">
<%if len(rs("bigclassname"))<=25 then%>
<%=rs("bigclassname")%>
<%else%>
<%=left(rs("bigclassname"),25)&"…"%>
<%end if%>


</span> </td>
</tr>
<%
rs.movenext
loopno=loopno-1
loop
end if
rs.close
set rs=Nothing
%>
<tr>
<td height="26" colspan="2" align="center" valign="top" bgcolor="#F2FFEE"><span style="font-size: 12px; color: #0066FF"> 共 <%=cstr(rcount)%> 个鸽舍 当前第 <%=cstr(pageno)&"/"&cstr(mpage)%> 页 每页 <%=pmcount%> 条
<%
if cint(pageno)>1 then%>
[ <a href='sheng.asp?pageno=<%=pageno-1%>&sheng=<%=request("sheng")%>' class="tt1">上一页</a> ]
<%
end if
if cint(pageno)<cint(mpage) then
%>
[ <a href='sheng.asp?pageno=<%=pageno+1%>&sheng=<%=request("sheng")%>' class="tt1">下一页</a> ]
<%end if%>
</span> </td>
</tr>
</table>

运行起来后说参数有冲突,请给看一下问题出在什么地方?

2006-07-05 13:54
hangxj
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:2045
专家分:0
注 册:2006-4-10
收藏
得分:0 
Select * From TableName Where FiledName1 Like '%"&SearchContent&"%' OR FiledName2 Like '%"&SearchContent2&"%'

Select * From TableName Where FiledName1 Like '%"&SearchContent&"%' AND FiledName2 Like '%"&SearchContent2&"%'


它提示什么参数错误,在多少行?把提示的贴上来吧

http://www./
2006-07-05 14:18
临风
Rank: 1
等 级:新手上路
帖 子:64
专家分:0
注 册:2006-7-5
收藏
得分:0 
已经解决,谢谢
2006-07-07 09:07
快速回复:[求助]我是新手 寻找ASP模糊查询程序
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011803 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved