📄 borrowbook.asp
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>借书</title>
</head>
<body bgcolor=#FF6600>
<table border="1" width="100%" id="table1">
<tr>
<td colspan="6">
<p align="center">图书馆藏书显示列表</td>
</tr>
<tr>
<td>书号</td>
<td>书名</td>
<td>总计数量</td>
<td>库存数目</td>
<td>借出数目</td>
<td>说明</td>
</tr>
<%
dim bookno
dim bookname
dim sumnumber
dim nownumber
dim lendnumber
dim describe
dim strConn
dim strSQL
dim objrst
strConn = "DSN=dblib;uid=;pwd=;database=db"
strSQL = "select * from Tbook"
set objrst = GetADORecordset (strConn,strSQL)
if objrst.bof and objrst.eof then
response.write "<html> <head>"
response.write "<title>显示书目</title>"
response.write "</head><body>"
response.write "<br><br><center><font size=5 color=navy><b>对不起,暂时没有可用的书!<br>"
response.write "</body></html>"
else
objrst.movefirst
while not objrst.eof
bookno = objrst.fields("bookno")
bookname = objrst.fields("bookname")
sumnumber = objrst.fields("sumnumber")
nownumber = objrst.fields("nownumber")
lendnumber = objrst.fields("lendnumber")
describe = objrst.fields("describe")
%>
<tr>
<td><%=bookno%></td>
<td><%=bookname%></td>
<td><%=sumnumber%></td>
<td><%=nownumber%></td>
<td><%=lendnumber%></td>
<td><%=describe%></td>
</tr>
<%objrst.movenext
wend
End if
%>
<%
'======================================================================
' GetADORecordset -- Gets an ADO recordset given a connectionstring,
' sql query string.
'
'==============================
Function GetADORecordset(strConn, strSQL)
On Error Resume Next
Dim objConnection
Dim objRecordset
Err.Clear
' Setup an ADO connection to the database:
Set objConnection = Server.CreateObject("ADODB.Connection")
Set objRecordset = Server.CreateObject("ADODB.Recordset")
objConnection.ConnectionString = strConn
objConnection.Open
Set objRecordset.ActiveConnection = objConnection
objRecordset.Source = strSQL
objRecordset.CursorLocation = 3
objRecordset.Open
If Err Then
Set GetADORecordset = Nothing
If Not HaveError() Then
SetError "GetADORecordset", Err.number, Err.Description
End If
Else
Set GetADORecordset = objRecordset
End If
End Function
%>
<form action="borrowbookdone.asp" method=post>
<table border="1" width="100%" id="table1">
<tr>
<td align="right" colspan="2">
<p align="center"><b>借书录入表</b></td>
</tr>
<tr>
<td align="right" width="50%">学生号:</td>
<td>
<input type="text" name="userno" size="20"></td>
</tr>
<tr>
<td align="right" width="50%">姓 名:</td>
<td><input type="text" name="username" size="20"></td>
</tr>
<tr>
<td align="right" width="50%">书 号:</td>
<td><input type="text" name="bookno" size="20"></td>
</tr>
<tr>
<td align="right" width="50%">书 名:</td>
<td><input type="text" name="bookname" size="20"></td>
</tr>
</table>
<table border="1" width="100%" >
<tr>
<td width="50%"><input type="submit" value="提交" name="B1" style="float: right"></td>
<td width="50%"><input type="reset" value="重置" name="B2"></td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -