📄 teacher.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 frmteacher
Caption = "教师信息管理"
ClientHeight = 3285
ClientLeft = 60
ClientTop = 420
ClientWidth = 5865
LinkTopic = "Form1"
ScaleHeight = 3285
ScaleWidth = 5865
StartUpPosition = 3 'Windows Default
Begin VB.TextBox Text3
Height = 375
Left = 1320
TabIndex = 13
Text = "Text3"
Top = 2280
Width = 1935
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 1560
Top = 2880
Visible = 0 'False
Width = 1935
_ExtentX = 3413
_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= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "teacher.frx":0000
Height = 255
Left = 120
TabIndex = 11
Top = 3120
Visible = 0 'False
Width = 5655
_ExtentX = 9975
_ExtentY = 450
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
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.CommandButton Command1
Caption = "添加教师"
Height = 495
Left = 4200
TabIndex = 10
Top = 240
Width = 1095
End
Begin VB.CommandButton Command4
Caption = "退出"
Height = 495
Left = 4200
TabIndex = 9
Top = 2760
Width = 1095
End
Begin VB.OptionButton Option1
Caption = "是否带课"
Height = 255
Left = 240
TabIndex = 8
Top = 2760
Width = 1455
End
Begin VB.ComboBox Combo1
Height = 315
Left = 1320
TabIndex = 7
Text = "Combo1"
Top = 1680
Width = 1935
End
Begin VB.TextBox Text1
Height = 375
Left = 1320
TabIndex = 3
Text = "Text1"
Top = 240
Width = 1815
End
Begin VB.TextBox Text2
Height = 375
Left = 1320
TabIndex = 2
Text = "Text2"
Top = 960
Width = 1815
End
Begin VB.CommandButton Command2
Caption = "删除教师"
Height = 495
Left = 4200
TabIndex = 1
Top = 1080
Width = 1095
End
Begin VB.CommandButton Command3
Caption = "查询信息"
Height = 495
Left = 4200
TabIndex = 0
Top = 1920
Width = 1095
End
Begin VB.Label Label4
Caption = "所带课程号:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 0
TabIndex = 12
Top = 2280
Width = 1215
End
Begin VB.Label Label3
Caption = "教师职称:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 6
Top = 1680
Width = 1215
End
Begin VB.Label Label1
Caption = "教师编号:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 5
Top = 240
Width = 1215
End
Begin VB.Label Label2
Caption = "教师姓名:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 4
Top = 960
Width = 1215
End
End
Attribute VB_Name = "frmteacher"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim cnn As ADODB.Connection
Dim cmd As ADODB.Command
Dim ret As ADODB.Recordset
Dim strcnn As String
Dim db As DAO.Database
Dim rec As DAO.Recordset
Dim dQuery As DAO.QueryDef
'添加教师 删除教师 教师信息查询
Private Sub Command1_Click()
Dim isdaike As String
If Option1.Value = False Then
isdaike = "否"
Else
isdaike = "是"
End If
strcnn = "User ID=Admin;Password=;Data Source=" & App.Path & "\db.mdb;Provider=Microsoft.Jet.OLEDB.3.51"
Set cnn = New ADODB.Connection
cnn.Open strcnn
Set cmd = New ADODB.Command
cmd.ActiveConnection = cnn
cmd.CommandText = "insert into 教师信息表 values('" + Text1.Text + "','" + Text2.Text + "','" + Combo1.Text + "')"
cmd.Execute
cmd.CommandText = "insert into 教师代课信息表 values('" + Text1.Text + "','" + Text3.Text + "','" + isdaike + "')"
cmd.Execute
cnn.Close
MsgBox ("添加教师成功!!")
End Sub
'删除教师
Private Sub Command2_Click()
Dim isdelete As Integer
isdelete = MsgBox("确实要删除吗?", vbExclamation + vbDefaultButton1 + vbYesNo, "提示信息")
If isdelete Then
strcnn = "User ID=Admin;Password=;Data Source=" & App.Path & "\db.mdb;Provider=Microsoft.Jet.OLEDB.3.51"
Set cnn = New ADODB.Connection
cnn.Open strcnn
Set cmd = New ADODB.Command
cmd.ActiveConnection = cnn
cmd.CommandText = "delete from 教师信息表 where 编号=val('" + Text1.Text + "')"
cmd.Execute
cmd.CommandText = "delete from 教师代课信息表 where 教师编号=val('" + Text1.Text + "')"
cmd.Execute
cnn.Close
MsgBox ("删除成功!!")
End If
End Sub
'教师信息查询
Private Sub Command3_Click()
Set db = OpenDatabase(App.Path & "\db.mdb")
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from 教师信息表,教师代课信息表 where 教师信息表.编号=教师代课信息表.教师编号"
Adodc1.Refresh
frmteacher.Height = 8000
DataGrid1.Visible = True
DataGrid1.Height = 4000
DataGrid1.Columns(0).Width = 600
DataGrid1.Columns(1).Width = 600
DataGrid1.Columns(2).Width = 800
DataGrid1.Columns(3).Width = 800
DataGrid1.Columns(4).Width = 600
DataGrid1.Columns(5).Width = 600
End Sub
'退出
Private Sub Command4_Click()
Me.Hide
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -