📄 frm课程.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Object = "{D27CDB6B-AE6D-11CF-96B8-444553540000}#1.0#0"; "Flash8a.ocx"
Begin VB.Form frmlessonin
BackColor = &H00FFFFFF&
BorderStyle = 1 'Fixed Single
Caption = "课程信息录入"
ClientHeight = 3210
ClientLeft = 45
ClientTop = 330
ClientWidth = 4485
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3210
ScaleWidth = 4485
Begin MSComCtl2.UpDown UpDown2
Height = 255
Left = 4080
TabIndex = 17
Top = 1800
Width = 255
_ExtentX = 450
_ExtentY = 450
_Version = 393216
Value = 1
Enabled = -1 'True
End
Begin MSComCtl2.UpDown UpDown1
Height = 255
Left = 1920
TabIndex = 16
Top = 2280
Width = 255
_ExtentX = 450
_ExtentY = 450
_Version = 393216
Value = 1
Max = 100
Enabled = -1 'True
End
Begin VB.TextBox txtlesson
Height = 270
Left = 3240
TabIndex = 1
Top = 1320
Width = 1095
End
Begin VB.TextBox txttime
Height = 270
Left = 1080
TabIndex = 4
Top = 2280
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "取消重录"
Height = 375
Left = 1560
TabIndex = 10
Top = 2760
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "退出录入"
Height = 375
Left = 3120
TabIndex = 8
Top = 2760
Width = 1095
End
Begin VB.CommandButton add
Caption = "确认录入"
Height = 375
Left = 120
TabIndex = 6
Top = 2760
Width = 1095
End
Begin VB.TextBox txtmark
DataField = "学分"
DataSource = "Adodc1"
Height = 270
Left = 3240
TabIndex = 3
Top = 1800
Width = 1095
End
Begin VB.TextBox txtNumber
DataField = "课程编号"
DataSource = "Adodc1"
Height = 270
Left = 1080
TabIndex = 0
Top = 1320
Width = 1095
End
Begin VB.ComboBox cobclass
Height = 300
Left = 3240
TabIndex = 5
Text = "cobclass"
Top = 2280
Width = 1095
End
Begin VB.ComboBox cobteacher
Height = 300
Left = 1080
TabIndex = 2
Text = "cobteacher"
Top = 1800
Width = 1095
End
Begin ShockwaveFlashObjectsCtl.ShockwaveFlash ShockwaveFlash1
Height = 1215
Left = -360
TabIndex = 15
Top = 0
Width = 5175
_cx = 9128
_cy = 2143
FlashVars = ""
Movie = ""
Src = ""
WMode = "Window"
Play = -1 'True
Loop = -1 'True
Quality = "High"
SAlign = ""
Menu = -1 'True
Base = ""
AllowScriptAccess= ""
Scale = "ShowAll"
DeviceFont = 0 'False
EmbedMovie = 0 'False
BGColor = ""
SWRemote = ""
MovieData = ""
SeamlessTabbing = -1 'True
Profile = 0 'False
ProfileAddress = ""
ProfilePort = 0
End
Begin VB.Label Label5
BackColor = &H00FFFFFF&
Caption = "课 时:"
Height = 255
Left = 120
TabIndex = 14
Top = 2280
Width = 975
End
Begin VB.Label Label4
BackColor = &H00FFFFFF&
Caption = "学 分:"
Height = 240
Left = 2280
TabIndex = 13
Top = 1800
Width = 945
End
Begin VB.Label Label3
BackColor = &H00FFFFFF&
Caption = "授课老师:"
Height = 240
Left = 120
TabIndex = 12
Top = 1800
Width = 945
End
Begin VB.Label Label2
BackColor = &H00FFFFFF&
Caption = "课程名称:"
Height = 195
Left = 2280
TabIndex = 11
Top = 1320
Width = 945
End
Begin VB.Label Label1
BackColor = &H00FFFFFF&
Caption = "课程编号:"
Height = 195
Left = 120
TabIndex = 9
Top = 1320
Width = 945
End
Begin VB.Label Label6
BackColor = &H00FFFFFF&
Caption = "对象班级:"
Height = 255
Left = 2280
TabIndex = 7
Top = 2280
Width = 975
End
End
Attribute VB_Name = "frmlessonin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub add_Click()
On Error GoTo errMsg
'学号
If Trim(txtnumber.Text) = "" Then
MsgBox "课程编号不能为空,请核实!", vbOKOnly + vbExclamation, "系统提示"
txtnumber.SetFocus
Exit Sub
End If
'姓名
If Trim(txtlesson.Text) = "" Then
MsgBox "课程名称不能为空,请核实!", vbOKOnly + vbExclamation, "系统提示"
coblesson.SetFocus
Exit Sub
End If
'学分
If Trim(txtmark.Text) = "" Then
MsgBox "学分不能为空,请核实!", vbOKOnly + vbExclamation, "系统提示"
txtmark.SetFocus
Exit Sub
End If
'课时
If Trim(txttime.Text) = "" Then
MsgBox "课时不能为空,请核实!", vbOKOnly + vbExclamation, "系统提示"
txttime.SetFocus
Exit Sub
End If
'课名
If Trim(txtlesson.Text) = "" Then
MsgBox "课程名称不能为空,请核实!", vbOKOnly + vbExclamation, "系统提示"
txtlesson.SetFocus
Exit Sub
End If
Dim SQL As String
SQL = "Select * From Lesson Where 课程编号='" & Trim(txtnumber.Text) & "'"
Set adoRS = adoCon.Execute(SQL)
If Not adoRS.EOF Then
MsgBox "课程编号为:" & Trim(txtnumber.Text) & "的课程已经存在!", vbOKOnly + vbExclamation, "系统提示"
txtnumber.SetFocus
Exit Sub
End If
'构造语句
SQL = ""
SQL = "exec lessonin"
SQL = SQL & " @lesson='" & Trim(txtlesson.Text) & "'"
SQL = SQL & " ,@lessonid='" & Trim(txtnumber.Text) & "'"
SQL = SQL & " ,@teacher='" & Trim(cobteacher.Text) & "'"
SQL = SQL & " ,@score='" & Trim(txtmark.Text) & "'"
SQL = SQL & " ,@class='" & Trim(cobclass.Text) & "'"
SQL = SQL & " ,@time='" & Trim(txttime.Text) & "'"
adoCon.Execute (SQL)
Call FillControl
MsgBox "录入成功!", vbOKOnly + vbInformation, "成功提示"
txtnumber.SetFocus
errMsg:
If Err.Number <> 0 Then
MsgBox Err.Number & Err.Description, vbOKOnly + vbCritical, "出错提示"
Exit Sub
End If
End Sub
Private Sub FillControl()
txtnumber.Text = ""
txtlesson.Text = ""
txtmark.Text = ""
txttime.Text = ""
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
On Error GoTo errMsg
Call FillControl
txtnumber.SetFocus
errMsg:
If Err.Number <> 0 Then
MsgBox Err.Number & Err.Description, vbOKOnly + vbCritical, "出错提示"
Exit Sub
End If
End Sub
Private Sub Form_Load()
txtmark.Text = UpDown2.Value
txttime.Text = UpDown1.Value
ShockwaveFlash1.Movie = App.Path & "\flash\top.swf"
Me.Height = 3690
Me.Width = 4605
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 - 800
'班级
Set adoRS = adoCon.Execute("Select Name From Class Order By Name")
cobclass.Clear
Do While Not adoRS.EOF
cobclass.AddItem adoRS("Name")
adoRS.MoveNext
Loop
cobclass.ListIndex = 0
'教师名
Set adoRS = adoCon.Execute("Select Name From Teacher Order By Name")
cobteacher.Clear
Do While Not adoRS.EOF
cobteacher.AddItem adoRS("Name")
adoRS.MoveNext
Loop
cobteacher.ListIndex = 0
End Sub
Private Sub UpDown1_Change()
txttime.Text = UpDown1.Value
End Sub
Private Sub UpDown2_Change()
txtmark.Text = UpDown2.Value
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -