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

📄 userborrowedbook.asp

📁 tushuguanlixitong 图书借阅系统 用ASP实现的 能实现简单的功能
💻 ASP
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户借书显示</title>
</head>
<body bgcolor=#FF6600>
<%
dim userno
dim username
dim bookno
dim bookname

dim strConn
dim strSQL
dim objrst

strConn = "DSN=dblib;uid=;pwd=;database=db"

strSQL = "select * from Tborrowed where userno = " & session("user_no") 

set objrst = GetADORecordset (strConn,strSQL)

 if objrst.bof and objrst.eof then

%>
<table border="1" width="100%" id="table1">
	<tr>
		<td align="center">
		<p>您没有借阅任何书籍!</td>
	</tr>
	<tr>
		<td align="center">左边是现在图书馆可以借阅的书籍的情况! </td>
	</tr>
</table>
<%
     else 
%>
<table border="1" width="100%"  id="table2">
	<tr>
		<td align="center" colspan="4">你现在的借书列表 </td>
	</tr>


	<tr>
		<td align="center">学生号</td>
		<td align="center">姓名</td>
		<td align="center">书号</td>
		<td align="center">书名</td>
	</tr>


<%         
          objrst.movefirst
		  while not objrst.eof
		  userno = objrst.fields("userno")
		  username = objrst.fields("username")
		  bookno = objrst.fields("bookno")
		  bookname = objrst.fields("bookname")
%>
<tr>
		<td align="center"><%=userno%></td>
		<td align="center"><%=username%></td>
		<td align="center"><%=bookno%></td>
		<td align="center"><%=bookname%></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

%>
</table>
</body>

</html>

⌨️ 快捷键说明

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