formgmmxg.frm

来自「企业员工信息管理系统.可以对企业的员工的各种信息进行管理」· FRM 代码 · 共 324 行

FRM
324
字号
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form密码修改 
   Caption         =   "密码修改"
   ClientHeight    =   5580
   ClientLeft      =   3795
   ClientTop       =   2985
   ClientWidth     =   7740
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   Picture         =   "FormGmmxg.frx":0000
   ScaleHeight     =   5580
   ScaleWidth      =   7740
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command3 
      BackColor       =   &H00FFFFC0&
      Caption         =   "退出"
      BeginProperty Font 
         Name            =   "华文行楷"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   6000
      Style           =   1  'Graphical
      TabIndex        =   10
      Top             =   4680
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      BackColor       =   &H00FFFFC0&
      Caption         =   "取消"
      BeginProperty Font 
         Name            =   "华文行楷"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   4560
      Style           =   1  'Graphical
      TabIndex        =   9
      Top             =   4680
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      BackColor       =   &H00FFFFC0&
      Caption         =   "确定"
      Default         =   -1  'True
      BeginProperty Font 
         Name            =   "华文行楷"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   3000
      Style           =   1  'Graphical
      TabIndex        =   8
      Top             =   4680
      Width           =   1335
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   495
      Left            =   720
      Top             =   4680
      Visible         =   0   'False
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   873
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   2
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=employer;Data Source=(local)"
      OLEDBString     =   "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=employer;Data Source=(local)"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "usermessege"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.TextBox Text3 
      Height          =   495
      IMEMode         =   3  'DISABLE
      Left            =   3360
      PasswordChar    =   "*"
      TabIndex        =   7
      Top             =   3720
      Width           =   2415
   End
   Begin VB.TextBox Text2 
      Height          =   495
      IMEMode         =   3  'DISABLE
      Left            =   3360
      PasswordChar    =   "*"
      TabIndex        =   5
      Top             =   2880
      Width           =   2415
   End
   Begin VB.TextBox Text1 
      Height          =   495
      IMEMode         =   3  'DISABLE
      Left            =   3360
      PasswordChar    =   "*"
      TabIndex        =   4
      Top             =   2040
      Width           =   2415
   End
   Begin VB.Label Label5 
      BackStyle       =   0  'Transparent
      Caption         =   "再次输入新密码:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1200
      TabIndex        =   6
      Top             =   3840
      Width           =   2055
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "新 密 码:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1920
      TabIndex        =   3
      Top             =   3000
      Width           =   1335
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "原 密 码:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1920
      TabIndex        =   2
      Top             =   2160
      Width           =   1455
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   615
      Left            =   3360
      TabIndex        =   1
      Top             =   1200
      Width           =   2415
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "用 户:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2280
      TabIndex        =   0
      Top             =   1200
      Width           =   975
   End
End
Attribute VB_Name = "Form密码修改"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
'判断原密码是否为空
If Len(Trim(Text1.Text)) = 0 Then
  MsgBox "原密码不允许为空!", vbOKOnly + vbExclamation, "警告"
  Text1.SetFocus
  Exit Sub
End If

'判断原密码是否正确
  Adodc1.CommandType = adCmdText
  Adodc1.RecordSource = "select * from usermessege where uname='" & Label2.Caption & "'"
  Adodc1.Refresh
 If Trim(Text1.Text) <> Trim(Adodc1.Recordset.Fields("Upassword").Value) Then
    MsgBox "原密码不正确!", vbOKOnly + vbExclamation, "警告"
    Text1.Text = ""
    Text2.Text = ""
    Text3.Text = ""
    Text1.SetFocus
    Exit Sub
  End If

'判断新密码是否为空
If Len(Trim(Text2.Text)) = 0 Then
  MsgBox "新密码不允许为空!", vbOKOnly + vbExclamation, "警告"
  Text2.SetFocus
  Exit Sub
End If
  
'限制密码长度
If Len(Trim(Text2.Text)) < 6 Or Len(Trim(Text2.Text)) > 16 Then
 MsgBox "密码必须为6-16位!", vbOKOnly + vbExclamation, "警告"
 Text2.Text = ""
 Text3.Text = ""
 Text2.SetFocus
 Exit Sub
End If
  
'判断灾次输入的密码是否为空
If Len(Trim(Text3.Text)) = 0 Then
  MsgBox "请再次输入密码!", vbOKOnly + vbExclamation, "警告"
  Text3.SetFocus
  Exit Sub
End If


'判断两次所输入的密码是否一致
If Text2.Text <> Text3.Text Then
        MsgBox "输入密码不一致,请重新输入", vbOKOnly + vbExclamation, "警告"
        Text2.Text = ""
        Text3.Text = ""
        Text2.SetFocus
        Exit Sub
End If

'修改密码
  MsgBox "恭喜你,修改密码成功!请记住你的新密码!", vbOKOnly + vbExclamation, "提示"
  Adodc1.Recordset.Fields("Upassword") = Trim(Text2.Text)
  Adodc1.Recordset.Update
  Adodc1.Refresh
  Text1.Text = ""
  Text2.Text = ""
  Text3.Text = ""
  Form用户管理.Show
  Me.Hide
End Sub

Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""

End Sub

Private Sub Command3_Click()
Form用户管理.Show
Me.Hide
End Sub

Private Sub Form_Load()
Label2.Caption = Form用户登录.Adodc1.UserName
End Sub

⌨️ 快捷键说明

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