📄 frmscore.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmScore
Caption = "成绩输入"
ClientHeight = 5550
ClientLeft = 60
ClientTop = 345
ClientWidth = 9015
Icon = "frmScore.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 5550
ScaleWidth = 9015
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 960
Top = 5640
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=eislink"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "eislink"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = $"frmScore.frx":0442
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Frame Frame3
Caption = "课程成绩输入"
Height = 2775
Left = 0
TabIndex = 13
Top = 2760
Width = 9015
Begin VB.CommandButton btnUpdate
Caption = "修改成绩"
Height = 375
Left = 7440
TabIndex = 17
Top = 1320
Width = 1215
End
Begin VB.TextBox txbScore
Height = 375
Left = 7560
TabIndex = 16
Top = 720
Width = 1215
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "frmScore.frx":04F6
Height = 2415
Left = 0
TabIndex = 14
Top = 240
Width = 6855
_ExtentX = 12091
_ExtentY = 4260
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin VB.Label Label6
Caption = "成绩"
Height = 255
Left = 7080
TabIndex = 15
Top = 840
Width = 495
End
End
Begin VB.Frame Frame2
Caption = "选择课程"
Height = 1335
Left = 0
TabIndex = 3
Top = 1440
Width = 9015
Begin VB.CommandButton btnSubmit
Caption = "最终提交"
Height = 375
Left = 2760
TabIndex = 12
Top = 720
Width = 975
End
Begin VB.CommandButton btnSearch
Caption = "查询"
Height = 375
Left = 2040
TabIndex = 11
Top = 720
Width = 615
End
Begin VB.TextBox txbName
Height = 375
Left = 2760
TabIndex = 10
Top = 240
Width = 975
End
Begin VB.TextBox txbId
Height = 375
Left = 840
TabIndex = 9
Top = 720
Width = 975
End
Begin VB.TextBox txbPY
Height = 375
Left = 840
TabIndex = 8
Top = 240
Width = 975
End
Begin VB.Label Label5
Caption = $"frmScore.frx":050B
Height = 975
Left = 4320
TabIndex = 7
Top = 240
Width = 4575
End
Begin VB.Label Label4
Caption = "课程名称"
Height = 255
Left = 2040
TabIndex = 6
Top = 360
Width = 855
End
Begin VB.Label Label3
Caption = "课程编号"
Height = 255
Left = 120
TabIndex = 5
Top = 840
Width = 735
End
Begin VB.Label Label2
Caption = "课程拼音"
Height = 255
Left = 120
TabIndex = 4
Top = 360
Width = 855
End
End
Begin VB.Frame Frame1
Caption = "结束选课,生成空成绩单"
Height = 1455
Left = 0
TabIndex = 0
Top = 0
Width = 9015
Begin VB.CommandButton btnClear
Caption = "终止选课,生成空成绩单"
Height = 375
Left = 360
TabIndex = 1
Top = 600
Width = 2295
End
Begin VB.Label Label1
Caption = $"frmScore.frx":05F3
Height = 975
Left = 3120
TabIndex = 2
Top = 360
Width = 4695
End
End
End
Attribute VB_Name = "frmScore"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub SetDGDList()
Dim strSQL As String
strSQL = "select b.课程名称,a.学号,c.姓名,a.成绩,"
strSQL = strSQL + " a.编号,a.课程编号 from 成绩表 as a, 课程信息 as b, "
strSQL = strSQL + "学生信息 as c where a.课程编号=b.课程编号 and a.学号"
strSQL = strSQL + "=c.学号 and 是否已确定成绩 = 'N' "
Dim strFilter As String
strFilter = ""
If Len(Trim(Me.txbPY.Text)) <> 0 Then
strFilter = strFilter + " and 拼音码 like '" + Trim(txbPY.Text) + "%'"
End If
If Len(Trim(Me.txbName.Text)) <> 0 Then
strFilter = strFilter + " and a.学号 like '" + Trim(txbId.Text) + "%'"
End If
If Len(Trim(Me.txbName.Text)) <> 0 Then
strFilter = strFilter + " and c.姓名 like '" + txbName.Text + "%'"
End If
If Len(Trim(strFilter)) = 0 Then
Exit Sub
Else
strFilter = strFilter + " order by b.课程名称,a.学号"
Dim db As New DataBases
Dim rs As Recordset
Set rs = db.RunSelectSQL(strSQL + strFilter)
Set Adodc1.Recordset = rs
End If
End Sub
Private Sub btnClear_Click()
Dim db As New DataBases
db.RunSelectSQL ("exec sf_终止选课")
End Sub
Private Sub btnSearch_Click()
SetDGDList
End Sub
Private Sub btnSubmit_Click()
If Adodc1.Recordset.EOF Or Adodc1.Recordset.BOF Then
Exit Sub
End If
Dim strSubject As String
strSubject = Trim(Adodc1.Recordset(5))
If MsgBox("提交后成绩不可以修改,是否确认提交?", vbYesNo) = vbYes Then
Dim strSQL As String
strSQL = "exec sf_成绩提交 " + strSubject
Dim db As New DataBases
db.RunSelectSQL (strSQL)
MsgBox ("提交成绩成功!")
SetDGDList
End If
End Sub
Private Sub btnUpdate_Click()
Dim score As Integer
score = CInt(txbScore.Text)
If Not Adodc1.Recordset.EOF And Not Adodc1.Recordset.BOF Then
Dim db As New DataBases
Dim strSQL As String
strSQL = "update 成绩表 set 成绩="
strSQL = strSQL + Trim(txbScore.Text) + " where 编号="
strSQL = strSQL + Trim(Adodc1.Recordset(4))
db.RunSelectSQL (strSQL)
SetDGDList
End If
End Sub
Private Sub Form_Load()
Dim db As New DataBases
Adodc1.ConnectionString = db.sConn
End Sub
Private Sub txbPY_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SetDGDList
End If
End Sub
Private Sub txbName_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SetDGDList
End If
End Sub
Private Sub txbId_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SetDGDList
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -