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

📄 userlist.asp

📁 tushuguanlixitong 图书借阅系统 用ASP实现的 能实现简单的功能
💻 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" bgcolor="#FF6600">
<tr>
		<td align="center">学生号</td>
		<td align="center">姓名</td>
		<td align="center">书号</td>
		<td align="center">书名</td>
	</tr>

<%
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 order by username"
set objrst = GetADORecordset (strConn,strSQL)
if objrst.bof and objrst.eof then

%>
<tr>
		<td align="center" colspan="4">没有任何人借书!</td>
	</tr>

<%

else
	      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
         set objrst=nothing
         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 + -