📄 changepwd.frm
字号:
VERSION 5.00
Begin VB.Form changpwd
BackColor = &H00FFFFC0&
Caption = "修改密码"
ClientHeight = 3615
ClientLeft = 60
ClientTop = 345
ClientWidth = 5100
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3615
ScaleWidth = 5100
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
BackColor = &H00FFFFC0&
Caption = "修改密码"
Height = 2295
Left = 600
TabIndex = 2
Top = 240
Width = 3855
Begin VB.TextBox Text3
Height = 270
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 8
Top = 480
Width = 1455
End
Begin VB.TextBox Text1
Height = 285
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 4
Top = 960
Width = 1455
End
Begin VB.TextBox Text2
Height = 285
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 3
Top = 1560
Width = 1455
End
Begin VB.Label Label3
BackColor = &H00FFFFC0&
Caption = "旧密码"
Height = 255
Left = 720
TabIndex = 7
Top = 480
Width = 735
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00FFFFC0&
Caption = "新密码"
Height = 195
Left = 720
TabIndex = 6
Top = 960
Width = 780
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H00FFFFC0&
Caption = "确认密码"
Height = 195
Left = 720
TabIndex = 5
Top = 1560
Width = 720
End
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2520
TabIndex = 1
Top = 2880
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 840
TabIndex = 0
Top = 2880
Width = 1095
End
End
Attribute VB_Name = "changpwd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
'Dim rs_chang As New ADODB.Recordset
'Dim sql As String
If Trim(Text3.Text = "") Then
MsgBox "旧密码不能为空,请重新输入!", vbOKOnly + vbExclamation, "警告"
Text3.SetFocus
Text3.Text = ""
Exit Sub
End If
If Trim(Text1.Text = "") Then
MsgBox "新密码不能为空,请重新输入!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Text1.Text = ""
Exit Sub
End If
If Text1.Text <> Text2.Text Then
MsgBox "两次输入的新密码不同,请重新输入!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Exit Sub
End If
Dim strSql As String
Dim rs As New ADODB.Recordset
strSql = "Select * from 系统管理 where 用户名 = '" & userID & "'"
rs.Open strSql, conn, adOpenForwardOnly, adLockReadOnly
If Trim(rs.Fields("密码")) <> Trim(Text3.Text) Then
MsgBox "旧密码不对,请重新输入!", vbOKOnly + vbExclamation, "警告"
Text3.SetFocus
Text3.Text = ""
Else
strSql = "Update 系统管理 set 密码 = '" & Text2.Text & "' where 用户名 = '" & userID & "'"
conn.Execute strSql
MsgBox "密码修改成功!", vbOKOnly + vbInformation, "提示"
Text3.Text = ""
Text1.Text = ""
Text2.Text = ""
Unload Me
End If
rs.Close
Set rs = Nothing
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -