?? frmscc.frm
字號:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "Msflxgrd.ocx"
Begin VB.Form frmSc
BackColor = &H80000005&
Caption = "選課管理"
ClientHeight = 7260
ClientLeft = 60
ClientTop = 345
ClientWidth = 10740
Icon = "frmScc.frx":0000
MDIChild = -1 'True
ScaleHeight = 7260
ScaleWidth = 10740
WindowState = 2 'Maximized
Begin VB.Frame Frame3
BackColor = &H80000005&
BorderStyle = 0 'None
Caption = "Frame3"
Height = 6615
Left = 240
TabIndex = 0
Top = 360
Width = 10215
Begin VB.Frame Frame1
BackColor = &H80000005&
Caption = "管理選課信息(&N)"
Height = 2535
Left = 480
TabIndex = 3
Top = 240
Width = 9255
Begin VB.ComboBox cobSno
Height = 300
Left = 1800
Style = 2 'Dropdown List
TabIndex = 11
Top = 360
Width = 1455
End
Begin VB.ComboBox cobCno
Height = 300
Left = 1800
Style = 2 'Dropdown List
TabIndex = 10
Top = 840
Width = 1455
End
Begin VB.TextBox TxtGrade
Height = 270
Left = 1800
TabIndex = 9
Text = "TxtGrade"
Top = 1320
Width = 1095
End
Begin VB.CommandButton cmdClear
BackColor = &H80000005&
Caption = "清除(&C)"
Height = 375
Left = 7080
Style = 1 'Graphical
TabIndex = 8
Top = 360
Width = 1335
End
Begin VB.CommandButton cmdSave
BackColor = &H80000005&
Caption = "修改(&S)"
Height = 375
Left = 7080
Style = 1 'Graphical
TabIndex = 7
Top = 840
Width = 1335
End
Begin VB.CommandButton cmdDel
BackColor = &H80000005&
Caption = "刪除(&D)"
Height = 375
Left = 7080
Style = 1 'Graphical
TabIndex = 6
Top = 1320
Width = 1335
End
Begin VB.CommandButton cmdExit
BackColor = &H80000005&
Caption = "退出(&X)"
Height = 375
Left = 7080
Style = 1 'Graphical
TabIndex = 5
Top = 1800
Width = 1335
End
Begin VB.ComboBox cobGrade
Height = 300
Left = 3480
TabIndex = 4
Text = "cobGrade "
Top = 1320
Visible = 0 'False
Width = 1455
End
Begin VB.Label Label1
BackColor = &H80000005&
Caption = "學生學號"
Height = 255
Left = 600
TabIndex = 17
Top = 360
Width = 855
End
Begin VB.Label Label2
BackColor = &H80000005&
Caption = "課程編號"
Height = 255
Left = 600
TabIndex = 16
Top = 840
Width = 855
End
Begin VB.Label Label3
BackColor = &H80000005&
Caption = "成績"
Height = 255
Left = 600
TabIndex = 15
Top = 1320
Width = 855
End
Begin VB.Label lbSname
BackColor = &H80000005&
Caption = "lbSname"
Height = 255
Left = 3480
TabIndex = 14
Top = 360
Width = 3015
End
Begin VB.Label lbCname
BackColor = &H80000005&
Caption = "lbCname"
Height = 255
Left = 3480
TabIndex = 13
Top = 840
Width = 3015
End
Begin VB.Label lbGrade
BackColor = &H80000005&
Caption = "lbGrade"
ForeColor = &H00808080&
Height = 255
Left = 1800
TabIndex = 12
Top = 1800
Width = 4575
End
End
Begin VB.Frame Frame2
BackColor = &H80000005&
Caption = "選課信息(&A)"
Height = 3255
Left = 480
TabIndex = 1
Top = 3120
Width = 9255
Begin VB.TextBox TextJls
BorderStyle = 0 'None
Enabled = 0 'False
Height = 270
Left = 960
TabIndex = 2
Text = "TextJls"
ToolTipText = "記錄總數"
Top = 240
Width = 1815
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 2415
Left = 1200
TabIndex = 18
Top = 600
Width = 6855
_ExtentX = 12091
_ExtentY = 4260
_Version = 393216
Cols = 4
BackColor = 16777088
ForeColor = 16711935
BackColorFixed = 16761024
ForeColorSel = 14737632
BackColorBkg = 16777215
HighLight = 2
GridLinesFixed = 1
SelectionMode = 1
AllowUserResizing= 2
BorderStyle = 0
Appearance = 0
End
End
End
End
Attribute VB_Name = "frmSc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim scjl As New ADODB.Recordset
Dim rs As New ADODB.Recordset
Dim SQL As String
Dim strCno As String
Dim strSno As String
Dim strCname As String
Dim strSname As String
Dim strGrade As String
Dim gRow As Integer
Private Sub cmdClear_Click()
Call Clear
End Sub
Private Sub Clear()
cobGrade.Text = ""
TxtGrade.Text = ""
TextJls.Text = ""
lbSname.Caption = ""
lbCname.Caption = ""
lbGrade.Caption = ""
Call Data_Display
End Sub
Private Sub cmdDel_Click()
Dim isOk As Integer
If cobSno.Text = "" Or cobCno.Text = "" Then
Call showMsg("學號和課程編號不能為空!", 1)
cobSno.SetFocus
Exit Sub
End If
isOk = MsgBox(vbCrLf & "您確定要刪除" & lbSname.Caption & "的選課信息么?", vbOKCancel + vbQuestion, "確認操作")
If isOk = vbOK Then
'刪除學生選課信息
SQL = "delete from jc_sc where sno='" & cobSno.Text & "' and cno='" & cobCno.Text & "' "
On Error GoTo errp
cnn.Execute (SQL)
End If
Call Data_Display
Exit Sub
errp:
Call showMsg("操作失敗 !", 0)
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -