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

📄 xianshi1.asp

📁 这是一个图书管理系统,也许能给大家一些帮助
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Connections/db1.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.Form("ts") <> "") Then 
  Recordset1__MMColParam = Request.Form("ts")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_db1_STRING
Recordset1.Source = "SELECT * FROM 图书 WHERE 书名 LIKE '%" + Replace(Recordset1__MMColParam, "'", "''") + "%' ORDER BY 版次 ASC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

Dim Recordset1_total
Dim Recordset1_first
Dim Recordset1_last

' set the record count
Recordset1_total = Recordset1.RecordCount

' set the number of rows displayed on this page
If (Recordset1_numRows < 0) Then
  Recordset1_numRows = Recordset1_total
Elseif (Recordset1_numRows = 0) Then
  Recordset1_numRows = 1
End If

' set the first and last displayed record
Recordset1_first = 1
Recordset1_last  = Recordset1_first + Recordset1_numRows - 1

' if we have the correct record count, check the other stats
If (Recordset1_total <> -1) Then
  If (Recordset1_first > Recordset1_total) Then
    Recordset1_first = Recordset1_total
  End If
  If (Recordset1_last > Recordset1_total) Then
    Recordset1_last = Recordset1_total
  End If
  If (Recordset1_numRows > Recordset1_total) Then
    Recordset1_numRows = Recordset1_total
  End If
End If
%>

<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (Recordset1_total = -1) Then

  ' count the total records by iterating through the recordset
  Recordset1_total=0
  While (Not Recordset1.EOF)
    Recordset1_total = Recordset1_total + 1
    Recordset1.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (Recordset1.CursorType > 0) Then
    Recordset1.MoveFirst
  Else
    Recordset1.Requery
  End If

  ' set the number of rows displayed on this page
  If (Recordset1_numRows < 0 Or Recordset1_numRows > Recordset1_total) Then
    Recordset1_numRows = Recordset1_total
  End If

  ' set the first and last displayed record
  Recordset1_first = 1
  Recordset1_last = Recordset1_first + Recordset1_numRows - 1
  
  If (Recordset1_first > Recordset1_total) Then
    Recordset1_first = Recordset1_total
  End If
  If (Recordset1_last > Recordset1_total) Then
    Recordset1_last = Recordset1_total
  End If

End If
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
.style1 {
	font-size: 24px;
	font-family: "幼圆";
	color: #0033CC;
}
.style2 {color: #0033CC; font-size: 24px;}
.style3 {
	font-size: 18px;
	color: #0033FF;
}
-->
</style>
</head>

<body>
<table width="600" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bordercolordark="#0066FF">
  <tr>
    <td height="336" align="center" valign="top"><p class="style1"><img src="tushuchaxun.png" width="600" height="93" border="1"></p>
      <p class="style1"><strong>图书目录</strong></p>
      <span class="style3">共有<%=(Recordset1_total)%> 本图书 <a href="chaxun1.asp">返回</a> </span>
        <form name="form1" method="post" action="">
          <table width="550" border="1" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bordercolordark="#0066CC">
            <tr>
              <td><div align="center">书名</div></td>
              <td><div align="center">作者</div></td>
              <td><div align="center">出版者</div></td>
              <td><div align="center">版次</div></td>
              <td><div align="center">是否借出</div></td>
              <td><div align="center">备注</div></td>
            </tr>
            <% 
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) 
%>
            <tr>
              <td><div align="center"><%=(Recordset1.Fields.Item("书名").Value)%></div></td>
              <td><div align="center"><%=(Recordset1.Fields.Item("作者").Value)%></div></td>
              <td><div align="center"><%=(Recordset1.Fields.Item("出版者").Value)%></div></td>
              <td><div align="center"><%=(Recordset1.Fields.Item("版次").Value)%></div></td>
              <td><div align="center"><%=(Recordset1.Fields.Item("是否借出").Value)%></div></td>
              <td><div align="center"><%=(Recordset1.Fields.Item("备注").Value)%></div></td>
            </tr>
            <% 
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  Recordset1.MoveNext()
Wend
%>
          </table>
        </form>
        <p class="style2">&nbsp;</p></td>
  </tr>
</table>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>

⌨️ 快捷键说明

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