| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2355 人关注过本帖
标题:[求助]有没有asp搜索的代码?
只看楼主 加入收藏
wood1088
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2005-4-10
收藏
 问题点数:0 回复次数:5 
[求助]有没有asp搜索的代码?
各位大大,本人急需asp中关于搜索的代码,就是搜索出关键字然后定位都相应答案的那种,那位大大提供给我啊,本人先在这里谢谢了 !可以发在这里,如果太大,请发到我的邮箱!iamwolf_2001@谢谢了
搜索更多相关主题的帖子: asp 搜索 代码 
2005-04-10 20:32
suyongtao
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:33
帖 子:8674
专家分:127
注 册:2004-11-6
收藏
得分:0 
在网上搜还是在你的站里的表里搜呀,

面朝大海,春暖花开!
2005-04-11 08:15
tyang
Rank: 1
等 级:新手上路
帖 子:216
专家分:0
注 册:2004-9-16
收藏
得分:0 
如果是搜索站里表的数据,去看看SQL的查询语句,你就会了

我的网站" target="_blank">http://www. 欢迎加入网站设计交流群:17222128
2005-04-11 08:44
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5810
专家分:118
注 册:2005-4-7
收藏
得分:0 
站内搜索用SQL语句就可以了,要是用搜索引擎的话,随便找个有搜索引擎的网站,用记事本打开,然后把相应的代码考出来就可以了

2005-04-11 09:20
wood1088
Rank: 1
等 级:新手上路
帖 子:24
专家分:0
注 册:2005-4-10
收藏
得分:0 

谢谢

2005-04-11 10:18
woyaotiwen
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-11-27
收藏
得分:0 
我的这段搜索模块的分页代码为什么只能显示不能分页请哪位高手帮我看一下,急用谢谢。


<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="../CSS/Style.css" rel="stylesheet" type="text/css">
<title>无标题文档</title>
</head>

<body>

<%

         dim Conn,RS,sqlStr,PageSize,RowCount,TotalPages,PageNo,Position,PageBegin,PageEnd
        
        uname=request.Form("uname")
 
         set Conn= Server.CreateObject("ADODB.Connection")

         set RS = Server.CreateObject("ADODB.RecordSet")

         Conn.open "provider=sqloledb;data source=(local);uid=sa;pwd=;database=datat"

         sqlStr="select * from indext where huowu='"&uname&"' or jine='"&uname&"' or jiezhang='"&uname&"' or jiansuo='"&uname&"' order by mid"

         RS.open sqlStr,Conn,1,1

         PageSize=2

         If RS.RecordCount=0 then

         %>
 
      
          <TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=1 style='font-size:9pt' align="center"  bgcolor="#D7DEF8">
          

                <tr bgcolor="#FFFFFF">
          <td width="5%" height="22" align="center">编号</td>
          <td width="8%" align="center">货物类型</td>
          <td width="8%" align="center">验货方</td>
          <td width="8%" align="center">金额</td>
          <td width="8%" align="center">货物状态</td>
          <td width="15%" align="center">发货日期</td>
          <td width="15%" align="center">到货日期</td>
          <td width="8%" align="center">结帐</td>
          <td width="10%" align="center">检索员</td>
         
        </tr>

                   <TR height=20px>

                   <TD align=center colspan="11">没有任何信息!</TD>

                   <TR>

        </TABLE>

         <%

         else

                   RS.PageSize = Cint(PageSize)

                   TotalPages=RS.PageCount

                   PageNo=Request.QueryString("PageNo")

                   if PageNo="" or PageNo<1 Then

                            PageNo = 1

                   end if

                   RS.AbsolutePage = PageNo

                  Position=RS.PageSize*PageNo

                   PageBegin=Position-RS.PageSize+1

                   if Position <RS.RecordCount then

                            PageEnd=Position

                   else

                            PageEnd= RS.RecordCount

                   end if

                   %>
                  
<fieldset style="padding: 5">
                   <TABLE WIDTH=100% BORDER=0 CELLPADDING=1 CELLSPACING=1 style='font-size:9pt' align="center">

                   <TR>

                   <TD colspan="11" align="left">

                   <%

          Response.Write "当前页号:"& PageNo &" / "& TotalPages &" | 记录:"& PageBegin & " - " & PageEnd & " / " &RS.RecordCount

                   %>

                   </TD>

                   <TD align=right>

                 

                   </TD>

                   </TR>

                   <TR  bgcolor="#D7DEF8">

          <td width="5%" align="center">编号</td>
          <td width="8%" align="center">货物类型</td>
          <td width="8%" align="center">验货方</td>
          <td width="8%" align="center">金额</td>
          <td width="8%" align="center">货物状态</td>
          <td width="15%" align="center">发货日期</td>
          <td width="15%" align="center">到货日期</td>
          <td width="8%" align="center">结帐</td>
          <td width="10%" align="center">检索员</td>
         
                   <%

                   RowCount = RS.PageSize

                   dim color1,color2

                   color1="#dddddd"

                   color2="#eeeeee"

                   Do While Not RS.EOF and RowCount > 0

                   Response.Write "<TR height=20px bgcolor="

                   %>

                   <%

                            if RowCount mod 2=0 then:response.write color1 else:response.write color2

                   %>

                   <%

                            Response.Write ">"

                   %>

         
                 

 <td width="6%" align="center"><%=rs("mid")%></td>
          <td width="10%" align="center"><%=rs("huowu")%></a></td>
          <td width="10%" align="center"><%=rs("yanhuo")%></td>
          <td width="8%" align="center"><%=rs("jine")%></td>
          <td width="8%" align="center"><%=rs("zhuangtai")%></td>
          <td width="15%" align="center"><%=rs("fahuo")%></td>
          <td width="15%" align="center"><%=rs("daohuo")%></td>
          <td width="8%" align="center"><%=rs("jiezhang")%></td>
           <td width="10%" align="center"><%=rs("jiansuo")%></td>
         
        </tr>

                   <%

                   RowCount = RowCount - 1

                   RS.MoveNext

                   Loop

                   Conn.Close

                   set RS = nothing

                   set Conn = nothing

                   %>

                   <TR>

                   <TD colspan="11" align="center">
                   <%

                            if PageNo > 1 Then

                                     response.write "<a href=iit.asp?PageNo=1>首页</a>&nbsp;<a href=iit.asp?PageNo=" & (PageNo-1) & ">上页</a>&nbsp;"

                            end if
                            %>

                   <%

                            For i=1 to TotalPages

                                     if CInt(PageNo) = CInt(i) then

                                               response.write "["&i&"]"

                                     else

                                               response.write "&nbsp<a href=iit.asp?PageNo="&i&">"&i&"</a>&nbsp"

                                     end if

                            Next

                   %>
                   
                            <%

                            if  TotalPages>1 and  cint(PageNo) <> cint(TotalPages) then

                                     response.write "<a href=iit.asp?PageNo=" & (PageNo+1) & ">下页</a>&nbsp;<a href=iit.asp?PageNo=" & TotalPages & ">末页</a>&nbsp;"

                            end if

                   %>

                   </TD>

                   </TR>

                   </TABLE>
                   
                   </fieldset>
</td>
  </tr>
</table>

                   <%

         End if

%>



</body>
</html>
2008-11-27 09:58
快速回复:[求助]有没有asp搜索的代码?
数据加载中...
 
   



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

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