📄 form1.frm
字号:
Height = 255
Left = 1320
TabIndex = 20
Top = 480
Width = 495
End
Begin VB.Label Label9
Caption = "Label9"
Height = 255
Left = 120
TabIndex = 16
Top = 1440
Width = 2775
End
Begin VB.Label Label8
Caption = "Label8"
Height = 255
Left = 120
TabIndex = 15
Top = 480
Width = 1215
End
Begin VB.Label Label7
Caption = "Label7"
Height = 255
Left = 120
TabIndex = 14
Top = 960
Width = 3735
End
Begin VB.Label Label6
Caption = "总宿舍数:"
Height = 255
Left = 120
TabIndex = 13
Top = 240
Width = 1575
End
End
End
End
Attribute VB_Name = "frmcase"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdAddCancel_Click()
Unload Me
End Sub
Private Sub CmdDelCancel_Click()
Unload Me
frmassist.Label1.Caption = "欢迎使用本系统!如有什么意见请及时向我们提出!谢谢!"
End Sub
Private Sub CmdUpdateCancel_Click()
End Sub
Private Sub cobclass_Click()
Dim sCon As String
sCon = "Select Count(*) as totalrecord from Student Where Class='" & cobclass.Text & "'"
Set adoRS = adoCon.Execute(sCon)
Do While Not adoRS.EOF
Label4.Caption = adoRS("totalrecord") & "人"
adoRS.MoveNext
Loop
End Sub
Private Sub cobcollege_Click()
sql = ""
sql = "select 专业 from Spcollege where 学院='" & cobcollege.Text & "'"
Set adoRS = adoCon.Execute(sql)
Cobsp1.Clear
Do While Not adoRS.EOF
Cobsp1.AddItem Trim(adoRS("专业"))
adoRS.MoveNext
Loop
End Sub
Private Sub cobcollege1_Click()
Dim sCon As String
sCon = "Select Count(*) as totalrecord from Student Where College='" & cobcollege1.Text & "'"
Set adoRS = adoCon.Execute(sCon)
Do While Not adoRS.EOF
Label17.Caption = adoRS("totalrecord") & "人"
Label4.Caption = "0人"
Label3.Caption = "0人"
adoRS.MoveNext
Loop
'专业
sql = ""
sql = "select 专业 from Spcollege where 学院='" & cobcollege1.Text & "'"
Set adoRS = adoCon.Execute(sql)
cobsp.Clear
Do While Not adoRS.EOF
cobsp.AddItem Trim(adoRS("专业"))
adoRS.MoveNext
Loop
End Sub
Private Sub coblesson1_Click()
sCon = "select avg(成绩) as 平均 from score Where 专业='" & Cobsp1.Text & "' and 班级='" & cobclass1.Text & "' and 课程='" & coblesson1.Text & "'"
Set adoRS = adoCon.Execute(sCon)
Do While Not adoRS.EOF
Label19.Caption = "平均" & adoRS("平均") & "分"
If Label19.Caption = "平均分" Then
Label19.Caption = "尚未录入成绩"
End If
adoRS.MoveNext
Loop
End Sub
Private Sub cobsp_Click()
Dim sCon As String
sCon = "Select Count(*) as totalrecord from Student Where Speciality='" & cobsp.Text & "'"
Set adoRS = adoCon.Execute(sCon)
Do While Not adoRS.EOF
Label3.Caption = adoRS("totalrecord") & "人"
Label4.Caption = "0人"
adoRS.MoveNext
Loop
'班级
sql = ""
sql = "select 班级 from Spclass where 专业='" & cobsp.Text & "'"
Set adoRS = adoCon.Execute(sql)
cobclass.Clear
Do While Not adoRS.EOF
cobclass.AddItem Trim(adoRS("班级"))
adoRS.MoveNext
Loop
End Sub
Private Sub Cobsp1_Click()
'班级
sql = ""
sql = "select 班级 from Spclass where 专业='" & Cobsp1.Text & "'"
Set adoRS = adoCon.Execute(sql)
cobclass1.Clear
Do While Not adoRS.EOF
cobclass1.AddItem Trim(adoRS("班级"))
adoRS.MoveNext
Loop
'lesson
sql = ""
sql = "select 课程 from Splesson where 专业='" & Cobsp1.Text & "'"
Set adoRS = adoCon.Execute(sql)
coblesson1.Clear
Do While Not adoRS.EOF
coblesson1.AddItem Trim(adoRS("课程"))
adoRS.MoveNext
Loop
End Sub
Private Sub Cobsushe_Click()
sCon = "Select Count(*) as totalrecord from Room Where 宿舍='" & Cobsushe.Text & "'"
Set adoRS = adoCon.Execute(sCon)
Do While Not adoRS.EOF
Label13.Caption = "有" & adoRS("totalrecord") & "人"
adoRS.MoveNext
Loop
End Sub
Private Sub cobteacher_Click()
Dim sCon As String
sCon = "Select Count(*) as totalrecord from Lesson Where 授课老师='" & cobteacher.Text & "'"
Set adoRS = adoCon.Execute(sCon)
Do While Not adoRS.EOF
Label11.Caption = "有" & adoRS("totalrecord") & "门课程"
adoRS.MoveNext
Loop
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim a, b, c As Integer
Me.Height = 3405
Me.Width = 4830
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 - 800
'学生
Set adoRS = adoCon.Execute("Select count(*) as totalrecord from Student")
Do While Not adoRS.EOF
Label1.Caption = "总学生人数:" & adoRS("totalrecord")
b = adoRS("totalrecord")
adoRS.MoveNext
Loop
'学院
Set adoRS = adoCon.Execute("Select Name From College Order By Name")
cobcollege.Clear
cobcollege1.Clear
Cobsp1.Clear
Do While Not adoRS.EOF
cobcollege.AddItem Trim(adoRS("Name"))
cobcollege1.AddItem Trim(adoRS("Name"))
adoRS.MoveNext
Loop
cobcollege.ListIndex = 0
cobcollege1.ListIndex = 0
Cobsp1.ListIndex = 0
'教师
Set adoRS = adoCon.Execute("Select Name From Teacher Order By Name")
cobteacher.Clear
Do While Not adoRS.EOF
cobteacher.AddItem Trim(adoRS("Name"))
adoRS.MoveNext
Loop
cobteacher.ListIndex = 0
'宿舍
Set adoRS = adoCon.Execute("Select Name From Live Order By Name")
Cobsushe.Clear
Do While Not adoRS.EOF
Cobsushe.AddItem Trim(adoRS("Name"))
adoRS.MoveNext
Loop
Cobsushe.ListIndex = 0
'老师
Set adoRS = adoCon.Execute("Select count(*) as totalrecord from Teacher")
Do While Not adoRS.EOF
Label5.Caption = "总教师人数:" & adoRS("totalrecord")
adoRS.MoveNext
Loop
'宿舍数
Set adoRS = adoCon.Execute("Select count(*) as totalrecord from Live")
Do While Not adoRS.EOF
Label6.Caption = "总宿舍数:" & adoRS("totalrecord")
Label12.Caption = "其中"
c = adoRS("totalrecord")
adoRS.MoveNext
Loop
'住宿人数
Set adoRS = adoCon.Execute("Select count(*) as totalrecord from Room")
Do While Not adoRS.EOF
Label8.Caption = "住宿人数:" & adoRS("totalrecord")
a = adoRS("totalrecord")
adoRS.MoveNext
Loop
Label7.Caption = "学生住宿率:" & Fix(a / b * 100) & "%"
'入住率
Label9.Caption = "宿舍入住率:" & Fix(a / (c * 4) * 100) & "%"
Label3.Caption = ""
Label4.Caption = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -