📄 addzhiwu.frm
字号:
VERSION 5.00
Begin VB.Form addzhiwu
BorderStyle = 1 'Fixed Single
Caption = "员工职务编辑"
ClientHeight = 2400
ClientLeft = 45
ClientTop = 450
ClientWidth = 4320
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 2400
ScaleWidth = 4320
Begin VB.CommandButton Command2
Caption = "返回"
Height = 375
Left = 2280
TabIndex = 5
Top = 1800
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 375
Left = 240
TabIndex = 4
Top = 1800
Width = 1095
End
Begin VB.TextBox Text2
Height = 375
Left = 1920
TabIndex = 3
Top = 1080
Width = 1455
End
Begin VB.TextBox Text1
Height = 375
Left = 1920
TabIndex = 2
Top = 360
Width = 1455
End
Begin VB.Label Label2
Caption = "职务名称:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 1
Top = 1080
Width = 1215
End
Begin VB.Label Label1
Caption = "职务编号:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 0
Top = 360
Width = 1215
End
End
Attribute VB_Name = "addzhiwu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim conn As New ADODB.Connection
conn.ConnectionString = " Provider=MSDASQL.1;Persist Security Info=False;Data Source=qygzgl"
conn.Open
If Trim(Text1.Text) <> Empty And Trim(Text2.Text) <> Empty Then
On Error GoTo ErrAddUser
conn.Execute "insert into 员工职务表(员工职务编号,员工职务名称)values('" & Text1.Text & "','" & Text2.Text & "')"
MsgBox "职务添加成功", , "添加成功"
Text1 = ""
Text2 = ""
Text1.SetFocus
Else
MsgBox "请输入要添加的部门编号和名称 ", vbInformation + vbOKOnly, "错误提示"
End If
Exit Sub
ErrAddUser:
MsgBox "该职务已存在 ", vbInformation + vbOKOnly, "提示信息"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -