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

📄 frmpassword.frm

📁 一个OA办公自动化管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   10.5
               Charset         =   134
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   390
            Left            =   1530
            Style           =   1  'Graphical
            TabIndex        =   3
            Top             =   240
            Width           =   1140
         End
         Begin VB.CommandButton cmdOK 
            BackColor       =   &H00C0E0FF&
            Caption         =   "确定(&K)"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   10.5
               Charset         =   134
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   390
            Left            =   240
            Style           =   1  'Graphical
            TabIndex        =   2
            Top             =   240
            Width           =   1140
         End
      End
      Begin VB.Label lblLabels 
         Caption         =   "旧 密 码:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   270
         Index           =   3
         Left            =   -74520
         TabIndex        =   19
         Top             =   480
         Width           =   1320
      End
      Begin VB.Label lblLabels 
         Caption         =   "新 密 码:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   270
         Index           =   2
         Left            =   -74520
         TabIndex        =   18
         Top             =   960
         Width           =   1320
      End
      Begin VB.Label Label2 
         Caption         =   "校验密码:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   -74520
         TabIndex        =   17
         Top             =   1440
         Width           =   1320
      End
      Begin VB.Label lblLabels 
         Caption         =   "用户名称:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   270
         Index           =   0
         Left            =   480
         TabIndex        =   10
         Top             =   480
         Width           =   1320
      End
      Begin VB.Label lblLabels 
         Caption         =   "密    码:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   270
         Index           =   1
         Left            =   480
         TabIndex        =   9
         Top             =   960
         Width           =   1320
      End
      Begin VB.Label Label1 
         Caption         =   "校验密码:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   480
         TabIndex        =   8
         Top             =   1440
         Width           =   1320
      End
   End
   Begin VB.Line Line1 
      BorderColor     =   &H80000001&
      BorderWidth     =   12
      X1              =   120
      X2              =   4560
      Y1              =   120
      Y2              =   120
   End
End
Attribute VB_Name = "frmpassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private rs As ADODB.Recordset
Private i As Integer

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
   If Trim(Me.txtPassword) = "" Or Trim(username) = "" Or Trim(Me.ctxtpassword) = "" Then
      MsgBox "请填写完整的资料!"
      Exit Sub
   End If
   If Trim(Me.txtPassword) <> Trim(Me.ctxtpassword) Then
      MsgBox "密码与校验密码不同!"
      Exit Sub
   End If
   Set rs = New ADODB.Recordset
   rs.Open "select * from password where name='" & Trim(Me.username.Text) & "'", GetConnect, adOpenStatic, adLockReadOnly
   If rs.RecordCount <> 0 Then
      MsgBox "用户名已存在,请改用其它名称!"
      rs.Close
      Exit Sub
   End If
   rs.Close
   Set rs = New ADODB.Recordset
   rs.Open "select * from password ", GetConnect, adOpenDynamic, adLockOptimistic
   rs.AddNew
      rs![Name] = Trim(Me.username)
      rs![Password] = Trim(Me.txtPassword)
   rs.Update
   rs.Close
   Unload Me
End Sub

Private Sub comadd_Click()
   If Trim(Me.txtPassword) = "" Or Trim(username) = "" Or Trim(Me.ctxtpassword) = "" Then
      MsgBox "请填写完整的资料!"
      Exit Sub
   End If
   If Trim(Me.txtPassword) <> Trim(Me.ctxtpassword) Then
      MsgBox "密码与校验密码不同!"
      Exit Sub
   End If
   Set rs = New ADODB.Recordset
   rs.Open "select * from password where name='" & Trim(Me.username.Text) & "'", GetConnect, adOpenStatic, adLockOptimistic
   If rs.RecordCount > 0 Then
      MsgBox "用户名已存在,请改用其它名称!"
   Else
      rs.AddNew
      rs![Name] = Trim(Me.username)
      rs![Password] = Trim(Me.txtPassword)
      rs.Update
   End If
   rs.Close
   Me.username = ""
   Me.txtPassword = ""
   Me.ctxtpassword = ""
End Sub

Private Sub comchangecancel_Click()
    Unload Me
End Sub

Private Sub comchangeok_Click()
   If Trim(Me.txtoldpassword) = "" Or Trim(txtchangepassword) = "" Or Trim(ctxtchangepassword) = "" Then
      MsgBox "请填写完整的资料!"
      Exit Sub
   End If
   If Trim(Me.txtchangepassword) <> Trim(Me.ctxtchangepassword) Then
      MsgBox "密码与校验密码不同!"
      Exit Sub
   End If
   Set rs = New ADODB.Recordset
   rs.Open "select * from password where password='" & Trim(Me.txtoldpassword.Text) & "'", GetConnect, adOpenDynamic, adLockOptimistic
  
   If rs.EOF And rs.BOF Then
      MsgBox "密码错误!"
      rs.Close
      Exit Sub
   Else
      rs![Password] = Trim(Me.txtchangepassword.Text)
      rs.UpdateBatch
      MsgBox "成功的修改密码!"
   End If
   rs.Close
   Unload Me
End Sub

Private Sub Form_Load()
Me.Top = 2050
Me.Left = 2000

End Sub

⌨️ 快捷键说明

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