📄 form8.frm
字号:
VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form Form8
Caption = "统计已修课程学分"
ClientHeight = 1845
ClientLeft = 60
ClientTop = 345
ClientWidth = 4860
LinkTopic = "Form8"
Picture = "Form8.frx":0000
ScaleHeight = 1845
ScaleWidth = 4860
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
BackColor = &H8000000E&
Height = 495
Left = 2640
Picture = "Form8.frx":2BEE2
Style = 1 'Graphical
TabIndex = 3
Top = 1080
Width = 975
End
Begin VB.CommandButton Command1
BackColor = &H8000000E&
Height = 495
Left = 720
Picture = "Form8.frx":2ED6F
Style = 1 'Graphical
TabIndex = 2
Top = 1080
Width = 975
End
Begin MSDataListLib.DataCombo DataCombo1
Height = 330
Left = 1680
TabIndex = 1
Top = 360
Width = 2055
_ExtentX = 3625
_ExtentY = 582
_Version = 393216
Text = ""
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请选择学生:"
Height = 180
Left = 360
TabIndex = 0
Top = 480
Width = 1080
End
End
Attribute VB_Name = "Form8"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim total As Integer, strsql As String
strsql = "select sum(学分) from 学生选课,课程表 where 学生选课.课程号=课程表.课程号 and 学生选课.学号 like'%" & Left(DataCombo1.Text, 6) & "%'"
If myrs.State = adStateOpen Then
myrs.Close
End If
Set myrs = mycon.Execute(strsql)
myrs.MoveFirst
If IsNull(myrs.Fields(0)) Then
total = 0
Else
total = myrs.Fields(0)
End If
MsgBox DataCombo1.Text & "的总学分为:" & Str(total), , "统计结果"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -