⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmpwdchange.frm

📁 员工信息管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmPwdChange 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "修改密码"
   ClientHeight    =   4125
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5910
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4125
   ScaleWidth      =   5910
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.TextBox txtOldPwd 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   2760
      MaxLength       =   8
      PasswordChar    =   "*"
      TabIndex        =   0
      Top             =   240
      Width           =   2055
   End
   Begin VB.TextBox txtNewPwd1 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   2760
      MaxLength       =   8
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   960
      Width           =   2055
   End
   Begin VB.TextBox txtNewPwd2 
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   2760
      MaxLength       =   8
      PasswordChar    =   "*"
      TabIndex        =   2
      Top             =   1800
      Width           =   2055
   End
   Begin VB.CommandButton cmdReturn 
      Caption         =   "返 回"
      Height          =   375
      Left            =   3840
      TabIndex        =   5
      Top             =   3000
      Width           =   975
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确 认"
      Default         =   -1  'True
      Height          =   375
      Left            =   960
      TabIndex        =   3
      Top             =   3000
      Width           =   975
   End
   Begin VB.Label lblNewPwd1 
      Caption         =   "新密码:"
      Height          =   255
      Left            =   960
      TabIndex        =   7
      Top             =   1080
      Width           =   735
   End
   Begin VB.Label lblNewPwd2 
      Caption         =   "确认新密码:"
      Height          =   255
      Left            =   960
      TabIndex        =   6
      Top             =   1920
      Width           =   1095
   End
   Begin VB.Label lblOldPwd 
      Caption         =   "旧密码:"
      Height          =   255
      Left            =   960
      TabIndex        =   4
      Top             =   360
      Width           =   735
   End
End
Attribute VB_Name = "frmPwdChange"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdReturn_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
    If Trim(txtOldPwd.Text = "") Then
        MsgBox "旧密码不能为空,请重新输入!", vbOKOnly + vbExclamation, "警告"
        txtOldPwd.SetFocus
        txtOldPwd.Text = ""
        Exit Sub
    End If
    
    If Trim(txtNewPwd1.Text = "") Then
        MsgBox "新密码不能为空,请重新输入!", vbOKOnly + vbExclamation, "警告"
        txtNewPwd1.SetFocus
        txtNewPwd1.Text = ""
        Exit Sub
    End If
    
    If txtNewPwd1.Text <> txtNewPwd2.Text Then
        MsgBox "两次输入的新密码不同,请重新输入!", vbOKOnly + vbExclamation, "警告"
        txtNewPwd1.SetFocus
        txtNewPwd1.Text = ""
        txtNewPwd2.Text = ""
        Exit Sub
    End If
    
    Dim strSql As String
    Dim rs As New ADODB.Recordset
    
    strSql = "Select user_pwd from sysuser where user_id = '" & loginUser & "'"
    rs.Open strSql, dbConn, adOpenForwardOnly, adLockReadOnly
    
    If Trim(rs.Fields("user_pwd")) <> Trim(txtOldPwd.Text) Then
        MsgBox "旧密码不对,请重新输入!", vbOKOnly + vbExclamation, "警告"
        txtOldPwd.SetFocus
        txtOldPwd.Text = ""
    Else
        strSql = "Update sysuser set user_pwd = '" & txtNewPwd1.Text & "' where user_id = '" & loginUser & "'"
        dbConn.Execute strSql
        MsgBox "密码修改成功!", vbOKOnly + vbInformation, "提示"
        txtOldPwd.Text = ""
        txtNewPwd1.Text = ""
        txtNewPwd2.Text = ""
        cmdReturn.SetFocus
    End If
    
    rs.Close
    Set rs = Nothing
End Sub

Private Sub Form_Load()
     Me.Icon = LoadPicture(App.Path & "\Graph07.ico")
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -