📄 form4.frm
字号:
VERSION 5.00
Begin VB.Form Form4
BorderStyle = 1 'Fixed Single
Caption = "用户密码管理"
ClientHeight = 2730
ClientLeft = 45
ClientTop = 330
ClientWidth = 3555
Icon = "Form4.frx":0000
LinkTopic = "Form4"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2730
ScaleWidth = 3555
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton cmdExit
Caption = "退出"
Height = 375
Left = 2040
TabIndex = 0
Top = 2040
Width = 1335
End
Begin VB.Frame Frame8
BackColor = &H80000000&
Caption = "修改密码"
Height = 2655
Left = 0
TabIndex = 1
Top = 0
Width = 3495
Begin VB.TextBox Text15
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 5
Top = 1440
Width = 1695
End
Begin VB.TextBox Text14
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 4
Top = 840
Width = 1695
End
Begin VB.TextBox Text13
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 3
Top = 240
Width = 1695
End
Begin VB.CommandButton Command4
Caption = "修改"
Height = 375
Left = 600
TabIndex = 2
Top = 2040
Width = 855
End
Begin VB.Label Label29
AutoSize = -1 'True
BackColor = &H80000000&
Caption = "新密码核实:"
Height = 180
Left = 240
TabIndex = 8
Top = 1560
Width = 990
End
Begin VB.Label Label28
AutoSize = -1 'True
BackColor = &H80000000&
Caption = "新密码:"
Height = 180
Left = 240
TabIndex = 7
Top = 960
Width = 630
End
Begin VB.Label Label27
AutoSize = -1 'True
BackColor = &H80000000&
Caption = "旧密码:"
Height = 180
Left = 240
TabIndex = 6
Top = 360
Width = 630
End
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub Command4_Click() '''密码修改
If Trim(Text13.Text) <> "" And Trim(Text14.Text) <> "" And Trim(Text15.Text) <> "" Then
If Trim(Text14.Text) <> Trim(Text15.Text) Then
MsgBox "新密码不对!", , "提示"
Exit Sub
Else
Dim rs1 As New ADODB.Recordset
If rs1.State Then rs1.Close
rs1.Open "select * from user_info where 姓名='" & UserName & "'", CN, adOpenStatic, adLockOptimistic
If Not rs1.EOF Then
If Not IsNull(rs1.Fields(1)) Then
If Trim(Text13.Text) <> Trim(rs1.Fields(1)) Then
MsgBox "用户旧密码不对!", , "提示"
Exit Sub
Else
rs1.Fields(1).Value = Trim(Text14.Text)
rs1.Update
MsgBox "操作已成功!", , "提示"
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
End If
End If
End If
End If
End If
End Sub
Private Sub Form_Load()
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -