📄 person_update.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form person_update
Caption = "修改个人资料"
ClientHeight = 5655
ClientLeft = 60
ClientTop = 465
ClientWidth = 4980
LinkTopic = "Form1"
ScaleHeight = 5655
ScaleWidth = 4980
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "退出"
Height = 495
Left = 2520
TabIndex = 14
Top = 4800
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 495
Left = 600
TabIndex = 13
Top = 4800
Width = 1335
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1680
TabIndex = 5
Top = 3480
Width = 1695
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 495
Left = 1680
TabIndex = 4
Top = 1200
Width = 1695
End
Begin VB.TextBox Text2
Enabled = 0 'False
Height = 495
Left = 1680
TabIndex = 3
Top = 1800
Width = 1695
End
Begin VB.TextBox Text3
Height = 495
Left = 1680
TabIndex = 2
Top = 2400
Width = 1695
End
Begin VB.TextBox Text4
Enabled = 0 'False
Height = 375
Left = 1680
TabIndex = 1
Top = 3000
Width = 1695
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 0
Top = 0
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_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 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db\teacher.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db\teacher.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select 部门名 from 部门表"
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 MSDataListLib.DataCombo DataCombo1
Bindings = "person_update.frx":0000
Height = 330
Left = 1680
TabIndex = 0
Top = 4080
Width = 1695
_ExtentX = 2990
_ExtentY = 582
_Version = 393216
ListField = "部门名"
Text = ""
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "修改个人资料"
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 495
Left = 1080
TabIndex = 12
Top = 480
Width = 2775
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "工 号"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Index = 0
Left = 360
TabIndex = 11
Top = 1200
Width = 1095
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "年 龄"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Index = 1
Left = 360
TabIndex = 10
Top = 2400
Width = 1095
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "姓 名"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Index = 2
Left = 360
TabIndex = 9
Top = 1800
Width = 1095
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "职 称"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Index = 3
Left = 360
TabIndex = 8
Top = 3480
Width = 1095
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "部 门"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Index = 4
Left = 360
TabIndex = 7
Top = 4080
Width = 1095
End
Begin VB.Label Label3
Alignment = 2 'Center
Caption = "性 别"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 495
Left = 240
TabIndex = 6
Top = 3000
Width = 1215
End
End
Attribute VB_Name = "person_update"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
sql = "update 教师表 set 年龄='" & Text3.Text & "' where 工号='" & Text1.Text & "'"
exesql (sql)
sql = "update 职称表 set 职称='" & Combo1.Text & "',部门='" & DataCombo1.Text & "' where 工号='" & Text1.Text & "'"
exesql (sql)
MsgBox "修改成功", vbOKOnly + vbExclamation, "信息提示"
person.Adodc1.Refresh
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
'初始化职称菜单
Combo1.AddItem "助教"
Combo1.AddItem "讲师"
Combo1.AddItem "副教授"
Combo1.AddItem "教授"
'显出选定工号对应的性别,年龄,姓名
Text1.Text = person.Adodc1.Recordset.Fields("工号")
Text2.Text = person.Adodc1.Recordset.Fields("姓名")
Text3.Text = person.Adodc1.Recordset.Fields("年龄")
Text4.Text = person.Adodc1.Recordset.Fields("性别")
Dim mrc As ADODB.Recordset
sql = "select * from 职称表 where 工号='" & person.Adodc1.Recordset.Fields("工号") & "'"
'查询对应工号的职称,部门
Set mrc = exesql(sql) '执行并返回
'显出选定工号对应的的职称,部门
Combo1.Text = mrc.Fields("职称")
DataCombo1.Text = mrc.Fields("部门")
mrc.Close '关闭Recordset对象
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -