📄 frmadduser.frm
字号:
VERSION 5.00
Begin VB.Form frmadduser
BorderStyle = 3 'Fixed Dialog
ClientHeight = 1680
ClientLeft = 45
ClientTop = 330
ClientWidth = 4110
Icon = "frmadduser.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1680
ScaleWidth = 4110
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "取消"
Height = 465
Left = 2970
TabIndex = 5
Top = 750
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确定"
Default = -1 'True
Height = 465
Left = 3000
TabIndex = 4
Top = 180
Width = 1095
End
Begin VB.TextBox Text2
BackColor = &H00C0FFFF&
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
IMEMode = 3 'DISABLE
Left = 1230
PasswordChar = "*"
TabIndex = 3
Top = 900
Width = 1515
End
Begin VB.TextBox Text1
BackColor = &H00C0FFFF&
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 1230
TabIndex = 2
Top = 270
Width = 1515
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "用户密码"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 90
TabIndex = 1
Top = 960
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "用户名称"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 60
TabIndex = 0
Top = 330
Width = 900
End
End
Attribute VB_Name = "frmadduser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
'安全性检查
If Text1.Text = "" Then
MsgBox "请输入操作员姓名!", vbOKOnly, "无用户名"
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "请输入用户密码!", vbOKOnly, "无密码"
Exit Sub
End If
On Error GoTo errhandler
If isxg = False Then
rspsw.AddNew
If Text1.Text <> "" Then rspsw.Fields("user_name") = Text1.Text
If Text2.Text <> "" Then rspsw.Fields("password") = Text2.Text
rspsw.Update
MsgBox "成功添加操作员!", vbOKOnly, "成功"
ElseIf isxg = True Then
Set rspsw = New ADODB.Recordset
rspsw.open "select user_name from load where user_name='" & Text1.Text & "'", cnYF, adOpenStatic, adLockPessimistic
If Text2.Text <> "" Then rspsw.Fields("user_name") = Text2.Text
rspsw.Update
t = MsgBox("成功更改操作员姓名!", vbOKOnly, "成功")
End If
Unload Me
Exit Sub
errhandler:
MsgBox err.Description, vbOKOnly, "出错"
End Sub
Private Sub Command2_Click()
If cn.State = 1 Then
cn.close
End If
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -