📄 frm_xiug.frm
字号:
VERSION 5.00
Begin VB.Form frm_xiug
BorderStyle = 3 'Fixed Dialog
Caption = "用户修改"
ClientHeight = 3750
ClientLeft = 45
ClientTop = 450
ClientWidth = 5790
Icon = "frm_xiug.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3750
ScaleWidth = 5790
ShowInTaskbar = 0 'False
Begin VB.Frame Frame1
Caption = "用户修改"
ForeColor = &H80000001&
Height = 3495
Left = 120
TabIndex = 0
Top = 120
Width = 5535
Begin VB.CommandButton Command2
Caption = "取 消"
Height = 375
Left = 3720
TabIndex = 15
Top = 2880
Width = 975
End
Begin VB.CommandButton Command1
Caption = "修 改"
Height = 375
Left = 720
TabIndex = 14
Top = 2880
Width = 975
End
Begin VB.Frame Frame2
Caption = "权限修改"
ForeColor = &H00000040&
Height = 735
Left = 0
TabIndex = 11
Top = 1920
Width = 5535
Begin VB.TextBox Text6
Height = 270
Left = 4440
TabIndex = 17
Top = 240
Visible = 0 'False
Width = 855
End
Begin VB.OptionButton Option2
Caption = "只能浏览数据"
ForeColor = &H00000080&
Height = 255
Left = 2760
TabIndex = 13
Top = 360
Width = 1455
End
Begin VB.OptionButton Option1
Caption = "数据所有权限"
ForeColor = &H00000080&
Height = 255
Left = 480
TabIndex = 12
Top = 360
Width = 1455
End
End
Begin VB.TextBox Text5
Appearance = 0 'Flat
BackColor = &H80000018&
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 10
Top = 1440
Width = 1335
End
Begin VB.TextBox Text4
Appearance = 0 'Flat
BackColor = &H80000018&
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 3960
PasswordChar = "*"
TabIndex = 8
Top = 840
Width = 1335
End
Begin VB.TextBox Text3
Appearance = 0 'Flat
BackColor = &H80000018&
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 6
Top = 840
Width = 1335
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
BackColor = &H80000018&
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3720
TabIndex = 4
Top = 240
Width = 1335
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
BackColor = &H80000018&
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 2
Top = 240
Width = 1335
End
Begin VB.Label Label6
Caption = "密码不进行修改请留空"
ForeColor = &H80000001&
Height = 255
Left = 3240
TabIndex = 16
Top = 1560
Width = 1935
End
Begin VB.Label Label5
Caption = "确认新密码:"
Height = 255
Left = 240
TabIndex = 9
Top = 1560
Width = 1095
End
Begin VB.Label Label4
Caption = "输入新密码:"
Height = 255
Left = 2880
TabIndex = 7
Top = 960
Width = 1095
End
Begin VB.Label Label3
Caption = "输入旧密码:"
Height = 255
Left = 240
TabIndex = 5
Top = 960
Width = 1095
End
Begin VB.Label Label2
Caption = "真实姓名:"
Height = 255
Left = 2760
TabIndex = 3
Top = 360
Width = 975
End
Begin VB.Label Label1
Caption = "用户帐号:"
Height = 255
Left = 240
TabIndex = 1
Top = 360
Width = 975
End
End
End
Attribute VB_Name = "frm_xiug"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text3.Text = "" Then
If Text4.Text <> "" Or Text5.Text <> "" Then
MsgBox "请输入旧密码才可以进行密码修改"
Text4.Text = ""
Text5.Text = ""
Else
With frm_yhgl.Adodc1.Recordset
.Fields("用户帐号") = Text1.Text
.Fields("真实姓名") = Text2.Text
.Fields("密码") = Text6.Text
If Option1.Value = True Then
.Fields("用户权限") = "所有权限"
Else
.Fields("用户权限") = "只能浏览"
End If
End With
frm_yhgl.Adodc1.Recordset.Update
frm_yhgl.Adodc1.Refresh
MsgBox "用户信息修改成功"
Unload Me
frm_yhgl.Enabled = True
End If
Else
If Text3.Text <> Text6.Text Then
MsgBox "用户旧密码输入不正确"
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text3.SetFocus
Else
If Text4.Text <> Text5.Text Then
MsgBox "两次输入的新密码不相同"
Text4.Text = ""
Text5.Text = ""
Text4.SetFocus
Else
With frm_yhgl.Adodc1.Recordset
.Fields("用户帐号") = Text1.Text
.Fields("真实姓名") = Text2.Text
.Fields("密码") = Text5.Text
If Option1.Value = True Then
.Fields("用户权限") = "所有权限"
Else
.Fields("用户权限") = "只能浏览"
End If
End With
frm_yhgl.Adodc1.Recordset.Update
frm_yhgl.Adodc1.Refresh
MsgBox "用户信息修改成功"
Unload Me
frm_yhgl.Enabled = True
End If
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
With frm_yhgl.Adodc1.Recordset
Text1.Text = .Fields("用户帐号")
Text2.Text = .Fields("真实姓名")
Text6.Text = .Fields("密码")
If .Fields("用户权限") = "所有权限" Then
Option1.Value = True
Else
Option2.Value = True
End If
End With
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Me
frm_yhgl.Enabled = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -