📄 form10.frm
字号:
VERSION 5.00
Begin VB.Form Form10
BackColor = &H00FFFF80&
Caption = "Form10"
ClientHeight = 5865
ClientLeft = 60
ClientTop = 345
ClientWidth = 9015
LinkTopic = "Form10"
ScaleHeight = 5865
ScaleWidth = 9015
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command5
BackColor = &H00FFFF80&
Caption = "查找"
Height = 495
Left = 5520
Style = 1 'Graphical
TabIndex = 11
Top = 2160
Width = 1575
End
Begin VB.TextBox Text2
Height = 615
Left = 2520
TabIndex = 10
Top = 2160
Width = 2535
End
Begin VB.CommandButton Command4
BackColor = &H00FFFF80&
Caption = "学生退出"
Height = 495
Left = 7320
Style = 1 'Graphical
TabIndex = 9
Top = 1200
Width = 1575
End
Begin VB.TextBox Text1
Height = 2175
Left = 360
MultiLine = -1 'True
TabIndex = 7
Top = 3000
Width = 7815
End
Begin VB.TextBox textfindname
Height = 615
Left = 2520
TabIndex = 6
Top = 1200
Width = 2535
End
Begin VB.TextBox textfindNum
Height = 495
Left = 2520
TabIndex = 3
Top = 360
Width = 2535
End
Begin VB.CommandButton Command2
BackColor = &H00FFFF80&
Caption = "管理员退出"
Height = 495
Left = 7320
Style = 1 'Graphical
TabIndex = 2
Top = 360
Width = 1575
End
Begin VB.CommandButton Command3
BackColor = &H00FFFF80&
Caption = "查找"
Height = 495
Left = 5520
Style = 1 'Graphical
TabIndex = 1
Top = 1200
Width = 1575
End
Begin VB.CommandButton Command1
BackColor = &H00FFFF80&
Caption = "查找"
Height = 495
Left = 5520
Style = 1 'Graphical
TabIndex = 0
Top = 360
Width = 1575
End
Begin VB.Label Label2
BackColor = &H00FFFF80&
Caption = "输入班级:"
Height = 375
Left = 600
TabIndex = 12
Top = 2280
Width = 1215
End
Begin VB.Label Label1
BackColor = &H00FFFF80&
Caption = "查找到条数:"
Height = 255
Left = 5880
TabIndex = 8
Top = 5400
Width = 2055
End
Begin VB.Label Label3
BackColor = &H00FFFF80&
Caption = "输入姓名:"
Height = 375
Left = 600
TabIndex = 5
Top = 1320
Width = 1215
End
Begin VB.Label Frame1
BackColor = &H00FFFF80&
Caption = "输入学号:"
Height = 375
Left = 600
TabIndex = 4
Top = 360
Width = 1095
End
End
Attribute VB_Name = "Form10"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Conn As ADODB.Connection
Dim rs As ADODB.Recordset
Private Const ConnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DATA.mdb;Persist Security Info=False"
Private Sub Command1_Click()
Dim i As Integer
i = 0
Text1.Text = ""
Dim strSql As String
Set Conn = New ADODB.Connection
Set rs = New ADODB.Recordset
Conn.Open ConnStr
strSql = "select * from 成绩表 where 学号='" & textfindNum.Text & "'"
rs.Open strSql, Conn, adOpenKeyset, adLockPessimistic
While Not rs.EOF
Text1.Text = Text1.Text & "班级:" & rs.Fields(0) & " " & "学号:" & rs.Fields(1) & _
" " & "姓名:" & rs.Fields(2) & " " & "高数:" & rs.Fields(3) & _
" " & "英语:" & rs.Fields(4) & " " & "物理:" & rs.Fields(5) & _
" " & "计算机:" & rs.Fields(6) & " " & "C语言:" & rs.Fields(7) & " " & vbCrLf
rs.MoveNext
i = i + 1
Wend
rs.Close
Conn.Close
Label1.Caption = "查找到条数:" & i
End Sub
Private Sub command2_Click()
Visible = False
Form2.Visible = True
Unload Form10
Form10.Command4.Visible = False
Form10.Command2.Visible = True
End Sub
Private Sub Command3_Click()
Dim i As Integer
i = 0
Text1.Text = ""
Dim strSql As String
Set Conn = New ADODB.Connection
Set rs = New ADODB.Recordset
Conn.Open ConnStr
strSql = "select * from 成绩表 where 姓名='" & textfindname.Text & "'"
rs.Open strSql, Conn, adOpenKeyset, adLockPessimistic
While Not rs.EOF
Text1.Text = Text1.Text & "班级:" & rs.Fields(0) & " " & "学号:" & rs.Fields(1) & _
" " & "姓名:" & rs.Fields(2) & " " & "高数:" & rs.Fields(3) & _
" " & "英语:" & rs.Fields(4) & " " & "物理:" & rs.Fields(5) & _
" " & "计算机:" & rs.Fields(6) & " " & "C语言:" & rs.Fields(7) & " " & vbCrLf
rs.MoveNext
i = i + 1
Wend
rs.Close
Conn.Close
Label1.Caption = "查找到条数:" & i
End Sub
Private Sub Command4_Click()
Visible = False
Form2.Visible = True
Unload Form10
Form2.mnuEditMod.Visible = False
Form2.mnuEditAdd.Visible = False
Form2.mnuEditDel.Visible = False
Form10.Command2.Visible = False
Form2.mmuCourseSort.Visible = False
Form2.mmuGradeCount.Visible = False
End Sub
Private Sub Command5_Click()
Dim i As Integer
i = 0
Text1.Text = ""
Dim strSql As String
Set Conn = New ADODB.Connection
Set rs = New ADODB.Recordset
Conn.Open ConnStr
strSql = "select * from 成绩表 where 班级='" & Text2.Text & "'"
rs.Open strSql, Conn, adOpenKeyset, adLockPessimistic
While Not rs.EOF
Text1.Text = Text1.Text & "班级:" & rs.Fields(0) & " " & "学号:" & rs.Fields(1) & _
" " & "姓名:" & rs.Fields(2) & " " & "高数:" & rs.Fields(3) & _
" " & "英语:" & rs.Fields(4) & " " & "物理:" & rs.Fields(5) & _
" " & "计算机:" & rs.Fields(6) & " " & "C语言:" & rs.Fields(7) & " " & vbCrLf
rs.MoveNext
i = i + 1
Wend
rs.Close
Conn.Close
Label1.Caption = "查找到条数:" & i
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -