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

📄 frmmodifyuserinfo.frm

📁 企业人事信息管理系统SQL版企业人事信息实现系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmModifyuserinfo 
   Caption         =   "修改密码"
   ClientHeight    =   4200
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   6480
   LinkTopic       =   "Form1"
   ScaleHeight     =   4200
   ScaleWidth      =   6480
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox Text1 
      Height          =   495
      IMEMode         =   3  'DISABLE
      Left            =   2280
      PasswordChar    =   "*"
      TabIndex        =   7
      Top             =   240
      Width           =   2295
   End
   Begin VB.CommandButton cmbCanel 
      Caption         =   "取消"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   3120
      TabIndex        =   5
      Top             =   2640
      Width           =   975
   End
   Begin VB.CommandButton cmbOK 
      Caption         =   "确定"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   1440
      TabIndex        =   4
      Top             =   2640
      Width           =   975
   End
   Begin VB.TextBox Text3 
      Height          =   495
      IMEMode         =   3  'DISABLE
      Left            =   2280
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   1680
      Width           =   2295
   End
   Begin VB.TextBox Text2 
      Height          =   495
      IMEMode         =   3  'DISABLE
      Left            =   2280
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   960
      Width           =   2295
   End
   Begin VB.Label Label1 
      Caption         =   "请输入原密码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   720
      TabIndex        =   6
      Top             =   360
      Width           =   1455
   End
   Begin VB.Label Label3 
      Caption         =   "请确认新密码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   720
      TabIndex        =   2
      Top             =   1800
      Width           =   1455
   End
   Begin VB.Label Label2 
      Caption         =   "请输入新密码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   720
      TabIndex        =   0
      Top             =   1080
      Width           =   1575
   End
End
Attribute VB_Name = "frmModifyuserinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmbCanel_Click()
Unload Me

End Sub

Private Sub cmbOK_Click()

  Dim txtSQL, MsgText As String
  Dim mr As ADODB.Connection
  Dim mrc As ADODB.Recordset
  
  Set mr = New ADODB.Connection
  Set mrc = New ADODB.Recordset
  mr.Open ("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=lydiatao;Data Source=WINXP-113")
  mrc.Open "user_info1", mr, adOpenKeyset, adLockOptimistic, adCmdTable

  
   If Trim(Text1.Text) <> PWD Then
  '判断是否是合法的用户
  MsgBox "原密码输入不正确!", vbOKOnly + vbExclamation, "警告"
     Text1.SetFocus
     Text1.Text = ""
     Exit Sub
  End If
     
  If Trim(Text2.Text) <> Trim(Text3.Text) Then
  '判断输入的新密码是否正确
     MsgBox "新密码输入不正确!", vbOKOnly + vbExclamation, "警告"
     Text2.SetFocus
     Text2.Text = ""
  Else
    txtSQL = "update user_info1 set PWD='" & Text2.Text & "'where username='" & UserName & "'"
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    mrc.Fields(2) = Text2.Text
    mrc.Update
    mrc.Close
    MsgBox "密码修改成功!", vbOKOnly + vbExclamation, "修改密码"
    Me.Hide
End If
    
End Sub

⌨️ 快捷键说明

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