⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newfind.asp

📁 大家好
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="ADOVBS.INC"-->
<%
   Findstr=trim(request.form("txtFindInfo"))
   if Findstr="" then
        response.redirect "sorry.htm"     
        response.end
   end if
   DbPath = SERVER.MapPath("..\bookshop.mdb")
   Set conn = Server.CreateObject("ADODB.Connection")
   conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DbPath
   set rs=server.createobject("adodb.recordset")
   sql="select * from book where bookname like '%"&Findstr&"%' order by bookbm"
   rs.open sql,conn,adOpenkeyset,adlockoptimistic,adcmdtext
   if rs.RecordCount<=0 then
          response.redirect "sorry.htm"     
          response.end
       else    
          i=0
          rs.PageSize=10
       end if
       PageCount=clng(rs.PageCount)
       if CurrPage<=0 then
          CurrPage=1
       end if
       if CurrPage>=PageCount then
          CurrPage=PageCount
       end if
       BookNum=rs.RecordCount      
       rs.absolutePage = CurrPage
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.OK1 {  font-family: "宋体"; font-size: 9pt; font-style: normal; font-weight: normal; color: #006600}
-->
</style>
</head>

<body bgcolor="#FFFFFF" link="#005f02" vlink="#00b06f" background="../FOTO/039.gif">
<h2 align="center"><font color="#000000">搜索结果</font></h2>
  
<table border="0" align="center" width="80%" >
  <tr> 
       
    <td colspan="5" align="left" height="25"><font size="2" color="#006600">选择当前页:</font></td>
       <td colspan="5" align="left" height="25"><font size="2" color="#006600">总页数:</font><font size="3"><% =PageCount %></font></td>
       <td colspan="5" align="left" height="25"><font size="2" color="#006600">当前页:</font><font size="3"><% =CurrPage %></font></td>
       <td colspan="5" align="left" height="25"><font size="2" color="#006600">每页记录数:</font><font size="3"><% =rs.PageSize %></font></td>
    </tr>
    <%  LinePage=18
       for i=0 to PageCount\LinePage-1 %> 
       <tr> <% for j=1 to LinePage %> 
           <td><font size="2" color="#006600"><a href=UpDown.asp?Find=<% =FindStr %>&CurrPage=<% =i*LinePage+j %>>[<% =i*LinePage+j %>]</a></font></td>
           <% next %> 
       </tr>
       <% next %> <%  EndPage=PageCount mod LinePage %> 
       <tr> <% for j=1 to EndPage %> 
            <td><font size="2" color="#006600"><a href=UpDown.asp?Find=<% =FindStr %>&CurrPage=<% =i*LinePage+j %>>[<% =i*LinePage+j %>]</a></font></td>
            <% next %> 
       </tr>
  </table>  
  
<hr width="80%">
<table border="1" align="center" width="80%" vspace="15" cellspacing="0" bordercolor="#666600">
  <tr border=1 valign="top" bgcolor="#6666ff"> 
    <td width="40%" align="center"><font color="#ffffff">商品名称</font></td>
    <td width="30%" align="center"><font color="#ffffff">生产厂家</font></td>
    <td width="10%" align="center"><font color="#ffffff"></font></td>
    <td width="10%" align="center"><font color="#ffffff"></font></td>
    <td width="10%" align="center"><font color="#ffffff"></font></td>
  </tr>
  <% do until rs.eof %> 
  <tr border="1" valign="top"> 
    <td bgcolor="#CCCCFF" width="40%" align="left" height="25"><%=rs("bookname")%></td>
    <td bgcolor="#CCCCFF" width="30%" align="center" height="25"><%=rs("Author")%></td>
    <td bgcolor="#CCCCFF" width="10%" align="center" height="25"><a href="xq.asp?bookbm=<%=rs("bookbm")%>" target="_TOP">详情</a></td>
    <td bgcolor="#CCCCFF" width="10%" align="center" height="25"><a href="QuesDelete.asp?bookbm=<%=rs("bookbm")%>&Class=<% =CurrClass %>&Field=<% =FindField %>&Find=<% =FindStr %>&CurrPage=<% =CurrPage %>" target="main">删除</a></td> 
    <td bgcolor="#CCCCFF" width="10%" align="center" height="25"><a href="Edit.asp?bookbm=<%=rs("bookbm")%>" target="main">修改</a></td>
</tr>
  <%   
        i=i+1
        if i>=rs.PageSize then exit do
        rs.movenext
        loop
        rs.close
        set rs=nothing
        set conn=nothing
     %> 
</table>    
<p>&nbsp;</p>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -