📄 frmcourseadmin.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "Msflxgrd.ocx"
Begin VB.Form frmCourseAdmin
BackColor = &H80000005&
Caption = "课程管理"
ClientHeight = 8775
ClientLeft = 60
ClientTop = 345
ClientWidth = 10590
Icon = "frmCourseAdmin.frx":0000
MDIChild = -1 'True
ScaleHeight = 8775
ScaleWidth = 10590
WindowState = 2 'Maximized
Begin VB.Frame Frame1
BackColor = &H80000005&
BorderStyle = 0 'None
Height = 8175
Left = 240
TabIndex = 0
Top = 360
Width = 9975
Begin VB.Frame FrameAdmin
BackColor = &H80000005&
Caption = "课程管理(&A)"
Height = 1935
Left = 960
TabIndex = 4
Top = 1320
Width = 8175
Begin VB.TextBox TxtCno
BackColor = &H8000000B&
Enabled = 0 'False
Height = 270
Left = 1680
TabIndex = 12
Text = "TxtCno"
Top = 360
Width = 1695
End
Begin VB.TextBox TxtCname
Height = 270
Left = 4920
TabIndex = 11
Text = "TxtCname"
Top = 360
Width = 1695
End
Begin VB.TextBox TxtTname
Height = 270
Left = 1680
TabIndex = 10
Text = "TxtTname"
Top = 720
Width = 1695
End
Begin VB.TextBox TxtCcredit
Height = 270
Left = 4920
TabIndex = 9
Text = "TxtCcredit"
Top = 720
Width = 975
End
Begin VB.CommandButton cmdClear
BackColor = &H80000005&
Caption = "清除(&C)"
Height = 375
Left = 4320
Style = 1 'Graphical
TabIndex = 8
Top = 1200
Width = 1335
End
Begin VB.CommandButton cmdSave
BackColor = &H80000005&
Caption = "保存修改(&S)"
Height = 375
Left = 480
Style = 1 'Graphical
TabIndex = 7
Top = 1200
Width = 1335
End
Begin VB.CommandButton cmdDel
BackColor = &H80000005&
Caption = "删除(&D)"
Height = 375
Left = 2400
Style = 1 'Graphical
TabIndex = 6
Top = 1200
Width = 1335
End
Begin VB.CommandButton cmdExit
BackColor = &H80000005&
Caption = "退出(&X)"
Height = 375
Left = 6120
Style = 1 'Graphical
TabIndex = 5
Top = 1200
Width = 1335
End
Begin VB.Label Label2
BackColor = &H80000005&
Caption = "课程名称"
Height = 255
Left = 3720
TabIndex = 17
Top = 360
Width = 1215
End
Begin VB.Label Label3
BackColor = &H80000005&
Caption = "授课老师姓名"
Height = 255
Left = 480
TabIndex = 16
Top = 720
Width = 1335
End
Begin VB.Label Label4
BackColor = &H80000005&
Caption = "课程学分"
Height = 255
Left = 3720
TabIndex = 15
Top = 720
Width = 855
End
Begin VB.Label Label1
BackColor = &H80000005&
Caption = "课程编号"
Height = 255
Left = 480
TabIndex = 14
Top = 360
Width = 1215
End
Begin VB.Label lbInfo
BackColor = &H80000005&
Height = 255
Left = 720
TabIndex = 13
Top = 1920
Width = 5415
End
End
Begin VB.Frame frameView
BackColor = &H80000005&
Caption = "已有课程(&V)"
Height = 3975
Left = 960
TabIndex = 2
Top = 3480
Width = 8175
Begin VB.ComboBox cobOrd
Height = 300
Left = 6840
Style = 2 'Dropdown List
TabIndex = 21
Top = 3480
Width = 1095
End
Begin VB.ComboBox cobOrdField
Height = 300
Left = 5160
Style = 2 'Dropdown List
TabIndex = 20
Top = 3480
Width = 1455
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 2895
Left = 240
TabIndex = 3
Top = 360
Width = 7695
_ExtentX = 13573
_ExtentY = 5106
_Version = 393216
Cols = 4
BackColor = 16777088
ForeColor = 16711935
BackColorFixed = 16761024
ForeColorSel = 14737632
BackColorBkg = 16777215
HighLight = 2
GridLinesFixed = 1
AllowUserResizing= 1
BorderStyle = 0
Appearance = 0
End
Begin VB.Label lbOrdWay
BackColor = &H80000005&
Caption = "选择数据的排序方式"
Height = 255
Left = 3075
TabIndex = 19
Top = 3480
Width = 1695
End
Begin VB.Label lbScounts
BackColor = &H80000005&
Caption = "lbScounts"
Height = 255
Left = 120
TabIndex = 18
Top = 3480
Width = 2775
End
End
Begin VB.Frame FrameFind
BackColor = &H80000005&
Caption = "查找(&F)"
Height = 1095
Left = 960
TabIndex = 1
Top = 120
Width = 8175
Begin VB.ComboBox cobField
Height = 300
Left = 480
Style = 2 'Dropdown List
TabIndex = 24
Top = 600
Width = 1575
End
Begin VB.CommandButton cmdFind
BackColor = &H80000005&
Caption = "查 询(&F)"
Height = 300
Left = 4680
Style = 1 'Graphical
TabIndex = 23
Top = 600
Width = 1455
End
Begin VB.TextBox TxtKeyword
Enabled = 0 'False
Height = 300
Left = 2160
TabIndex = 22
Top = 600
Width = 2175
End
Begin VB.Label Label6
BackColor = &H80000005&
Caption = "选择查询方式,输入关键字:"
Height = 255
Left = 480
TabIndex = 25
Top = 240
Width = 2535
End
End
End
End
Attribute VB_Name = "frmCourseAdmin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rs As New ADODB.Recordset
Dim SQL As String
Dim gRow As Integer
Dim strFieldName As String
Dim StrOrd As String
Private Sub Clear()
TxtCno.Text = ""
TxtCname.Text = ""
TxtTname.Text = ""
TxtCcredit.Text = ""
End Sub
Private Sub cmdClear_Click()
Call Clear
End Sub
Private Sub cmdDel_Click()
Dim isOk As Integer
If TxtCno.Text = "" Then
Call showMsg("课程编号不能为空!", 1)
Exit Sub
End If
isOk = MsgBox("删除该课程将同时删除学生所选的这门课程信息。" & vbCrLf & "您确定要删除么?", vbOKCancel + vbQuestion, "确认操作")
If isOk = vbOK Then
'删除课程信息
SQL = "delete from jc_c where cno='" & TxtCno.Text & "'"
On Error Resume Next
cnn.Execute (SQL)
'删除对应的选课信息
SQL = "delete from jc_sc where cno='" & TxtCno.Text & "'"
On Error Resume Next
cnn.Execute (SQL)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -