📄 frminform.frm
字号:
VERSION 5.00
Begin VB.Form frmInform
Caption = "还书通知"
ClientHeight = 2505
ClientLeft = 60
ClientTop = 450
ClientWidth = 3945
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 2505
ScaleWidth = 3945
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame1
Caption = "今天借书到期学生通知列表:"
Height = 2295
Left = 120
TabIndex = 0
Top = 120
Width = 3735
Begin VB.ListBox lstSName
Appearance = 0 'Flat
Height = 1830
Left = 1920
TabIndex = 2
Top = 360
Width = 1695
End
Begin VB.ListBox lstSID
Appearance = 0 'Flat
Height = 1830
Left = 240
TabIndex = 1
Top = 360
Width = 1695
End
End
End
Attribute VB_Name = "frmInform"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim strSID() As String
Private Sub Form_Load()
Dim strsql As String
Dim rsInf As New ADODB.Recordset
Dim iCount As Integer
Dim i As Integer
strsql = "select sid from tblborrow where returndate = #" & Date & "#"
lstSID.Clear
rsInf.Open strsql, conLIB, adOpenStatic, adLockOptimistic
If rsInf.EOF And rsInf.BOF Then
MsgBox "今天没有到期的图书", vbOKOnly, "提示"
Exit Sub
Else
rsInf.MoveFirst
iCount = rsInf.RecordCount
i = 0
' MsgBox iCount
ReDim strSID(iCount)
rsInf.MoveFirst
While Not rsInf.EOF
strSID(i) = rsInf!sid
lstSID.AddItem strSID(i)
i = i + 1
rsInf.MoveNext
Wend
ShowName
End If
End Sub
Private Sub ShowName()
Dim i As Integer
Dim rsStudent As New ADODB.Recordset
Dim strsql As String
For i = 0 To UBound(strSID)
strsql = "select sname from tblstudents where sid='" & strSID(i) & "'"
If rsStudent.State = adStateOpen Then rsStudent.Close
rsStudent.Open strsql, conLIB, adOpenStatic
If rsStudent.EOF Then
Else
lstSName.AddItem rsStudent!sname
End If
Next i
rsStudent.Close
Set rsStudent = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -