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

📄 booklists.asp

📁 所在类别: 随书资源/T 工业技术/TP 自动化技术、计算机技术/TP31 计算机软件 其他题名: 作者: 夏邦贵, 刘凡馨等编著 出版者: 机械工业出版社 出版年: 2006 I
💻 ASP
字号:
<%@ LANGUAGE="VBScript"  %><% Response.Buffer=true %>
<HTML>
<HEAD>
    <TITLE>在线图书销售管理系统</TITLE>
</HEAD>
<BODY>
<CENTER>
<H3>在线图书销售管理系统--查询图书信息</H3>
<HR>
<FORM action="BookLists.asp" method="post" target="_parent">
<NOBR>按
<SELECT id="SELECT1" name="SeachKey">
   <OPTION <%if request("seachkey")="book_name" or request("seachkey")="" then response.write "selected"%> value="book_name">书名</OPTION>
   <OPTION <%if request("seachkey")="book_writer" then response.write "selected"%> value="book_writer">作者</OPTION>
   <OPTION <%if request("seachkey")="book_press" then response.write "selected"%> value="book_press">出版社</OPTION>
   <OPTION <%if request("seachkey")="book_brief" then response.write "selected"%> value="book_brief">内容简介</OPTION>
</SELECT> 查询 <INPUT id="INPUT1" name="SeachContent" value='<%=request("seachcontent")%>'> 
<INPUT id="INPUT2" type="submit" value="查询"> 
</NOBR>
</FORM>
</CENTER>
<BR>
<% on error resume next
'建立数据库连接
Set cn=Server.CreateObject("ADODB.Connection") 
cn.connectionstring="Provider=SQLOLEDB;UID=sa;pwd=123;" & _
              "database=图书销售;Data Source=(local)"
cn.Open 
'访问数据库获得图书信息
Set rstemp=Server.CreateObject("ADODB.Recordset")
if request("seachcontent")="" then
   querystr = "select top 10 book_id,book_name from 图书信息 "
else
   querystr = "select book_id,book_name from 图书信息 Where " & request("seachkey") & " LIKE '%" & request("seachcontent") & "%'"
end if
Set rstemp.ActiveConnection = cn
rstemp.CursorType =1
rstemp.LockType = 3
rstemp.PageSize=10
rstemp.Open querystr 
if request("seachcontent")="" then
   response.write "销售排名前十的图书名单如下:<p>"
else
   response.write "共找到<b>"
   response.write rstemp.recordcount
   response.write "</b>条“<font color=red><i><b>"
   select case request("seachkey")
      case "book_name"
        response.write "书名" 
      case "book_writer"
        response.write "作者"
      case "book_press"
        response.write "出版社"
      case "book_brief"
        response.write "内容简介"
   end select
   response.write "</b></i></font>”包含“<font color=red><i><b>" 
   response.write request("seachcontent") & "</b></i></font>”的记录:<p>"
end if
if rstemp.recordcount>0 then   
   n=1
   if request("rspageindex")<>"" then
      rstemp.AbsolutePage=request("rspageindex")
      n=(rstemp.AbsolutePage-1)*rstemp.PageSize+1 
   end if
   thispageindex=rstemp.AbsolutePage   
   m=1
   while m<=rstemp.PageSize and not rstemp.eof
       response.write m+n-1
       response.write "."
       response.write "<a  target=_Blank href=BooksInfoDetail.asp?BookID="
       response.write rstemp.fields(0)
       response.write ">"       
       response.write rstemp.fields(1)
       response.write "</a><br>"
       m=m+1
       rstemp.movenext
   wend
   if rstemp.pagecount>1 then
      response.write "<p><div align=center>共"
      response.write rstemp.pagecount
      response.write "页:&nbsp;"
      for i=1 to rstemp.pagecount
        if i <> thispageindex then 
           response.write "<a href=BookLists.asp?rspageindex="
           response.write i
           response.write "&"
           response.write "seachkey=" & request("seachkey")
           response.write "&"
           response.write "seachcontent=" & request("seachcontent")
           response.write ">"
           response.write i        
           response.write "</a>&nbsp;"
        else
           response.write i
           response.write "&nbsp;"
        end if
      next 
      response.write "</div>"
   end if
end if
rstemp.close
cn.close
set rstemp=nothing
set cn=nothing
response.flush
%>
<HR>
<DIV align="center"><A HREF="booksaling.htm">返回首页</A></DIV>
</BODY>
</HTML>

⌨️ 快捷键说明

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