?? frmzy.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Frmzy
Caption = "添加或刪除專業"
ClientHeight = 3600
ClientLeft = 60
ClientTop = 450
ClientWidth = 6930
LinkTopic = "Form1"
ScaleHeight = 3600
ScaleWidth = 6930
StartUpPosition = 3 '窗口缺省
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 360
Top = 3120
Visible = 0 'False
Width = 1575
_ExtentX = 2778
_ExtentY = 661
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= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=student_data\student_massage.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=student_data\student_massage.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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.CommandButton Command3
Caption = "取消"
Height = 375
Left = 2760
TabIndex = 10
Top = 3120
Width = 1575
End
Begin VB.Frame Frame2
Caption = "刪除專業"
Height = 2655
Left = 3480
TabIndex = 1
Top = 360
Width = 3255
Begin VB.CommandButton Command2
Caption = "確定刪除"
Height = 375
Left = 600
TabIndex = 9
Top = 1920
Width = 1575
End
Begin VB.ComboBox Combo1
Height = 300
Left = 240
TabIndex = 6
Text = "請選擇"
Top = 720
Width = 2415
End
Begin VB.Label Label4
AutoSize = -1 'True
BeginProperty Font
Name = "楷體_GB2312"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 285
Left = 240
TabIndex = 8
Top = 1440
Width = 2415
End
Begin VB.Label Label3
Caption = "您要刪除的專業是:"
BeginProperty Font
Name = "楷體_GB2312"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 7
Top = 1080
Width = 2415
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "選擇要刪除的專業"
BeginProperty Font
Name = "楷體_GB2312"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 240
TabIndex = 5
Top = 240
Width = 2400
End
End
Begin VB.Frame Frame1
Caption = "添加專業"
Height = 2655
Left = 360
TabIndex = 0
Top = 360
Width = 3015
Begin VB.CommandButton Command1
Caption = "確定添加"
Height = 375
Left = 720
TabIndex = 4
Top = 1920
Width = 1695
End
Begin VB.TextBox Text1
Height = 375
Left = 480
TabIndex = 2
Top = 720
Width = 2175
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "新專業名稱"
BeginProperty Font
Name = "楷體_GB2312"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 480
TabIndex = 3
Top = 240
Width = 1500
End
End
End
Attribute VB_Name = "Frmzy"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub combo()
Combo1.Clear
Combo1.Text = "請選擇"
Adodc1.RecordSource = "select * from 專業 "
Adodc1.Refresh
With Adodc1.Recordset
.MoveFirst
Do While Not .EOF
Combo1.AddItem .Fields(0)
.MoveNext
Loop
End With
End Sub
Private Sub Combo1_Click()
If Combo1.Text = "請選擇" Then
Label4.Caption = ""
Else
Label4.Caption = Combo1.Text
End If
End Sub
Private Sub Command1_Click()
Adodc1.RecordSource = "select * from 專業 where 專業名稱='" & Text1.Text & "'"
Adodc1.Refresh
With Adodc1.Recordset
If Text1.Text = "" Then
MsgBox "請輸入您要添加的專業", vbOKOnly, "提示"
Call FocusBack(Text1)
Else
If .EOF Then
.AddNew
.Fields(0).Value = Trim$(Text1.Text)
.Update
MsgBox "添加專業成功!", vbOKOnly, "添加成功"
Else
MsgBox "此專業已經存在", vbExclamation, "錯誤"
Call FocusBack(Text1)
Exit Sub
End If
End If
End With
Call combo
Call Combo1_Click
Text1.Text = ""
End Sub
Private Sub Command2_Click()
Dim del As Integer
Adodc1.RecordSource = "select * from 專業 where 專業名稱='" & Combo1.Text & "'"
Adodc1.Refresh
With Adodc1.Recordset
If Combo1.Text = "請選擇" Then
MsgBox "請選擇專業", vbOKOnly, "提示"
Else
del = MsgBox("刪除該專業,將會刪除該專業中所有的班級" & vbCr & "你確定刪除“" & Combo1.Text & "”專業嗎?", vbYesNo + vbQuestion + vbDefaultButton2, "提示")
If del = 6 Then
.Delete
.Update
MsgBox "刪除成功", vbOKOnly, "提示"
Call combo
Call Combo1_Click
Label4.Caption = ""
End If
End If
End With
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Call combo
End Sub
Private Sub Form_Initialize()
ChDrive App.Path
ChDir App.Path
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -