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

📄 frmmmgl_input.frm

📁 自来水公司的一个管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmMMGL_Input 
   Caption         =   "密码修改"
   ClientHeight    =   2910
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5415
   Icon            =   "frmMMGL_Input.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2910
   ScaleWidth      =   5415
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton cmdCancel 
      Caption         =   "放弃"
      Height          =   360
      Left            =   1200
      TabIndex        =   4
      Top             =   2340
      Width           =   960
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定"
      Height          =   360
      Left            =   210
      TabIndex        =   3
      Top             =   2340
      Width           =   960
   End
   Begin VB.TextBox txtEID 
      Enabled         =   0   'False
      Height          =   330
      Left            =   690
      MaxLength       =   8
      TabIndex        =   11
      Top             =   135
      Width           =   1065
   End
   Begin VB.TextBox txtName 
      Enabled         =   0   'False
      Height          =   330
      Left            =   2700
      MaxLength       =   8
      TabIndex        =   9
      Top             =   135
      Width           =   1560
   End
   Begin VB.Frame Frame1 
      Height          =   1710
      Left            =   150
      TabIndex        =   5
      Top             =   510
      Width           =   5070
      Begin VB.TextBox txtNewMMJY 
         Height          =   330
         IMEMode         =   3  'DISABLE
         Left            =   1320
         MaxLength       =   6
         PasswordChar    =   "*"
         TabIndex        =   2
         Top             =   1170
         Width           =   2145
      End
      Begin VB.TextBox txtNewMM 
         Height          =   330
         IMEMode         =   3  'DISABLE
         Left            =   1320
         MaxLength       =   6
         PasswordChar    =   "*"
         TabIndex        =   1
         Top             =   705
         Width           =   2145
      End
      Begin VB.TextBox txtOldMM 
         Height          =   330
         IMEMode         =   3  'DISABLE
         Left            =   1320
         MaxLength       =   6
         PasswordChar    =   "*"
         TabIndex        =   0
         Top             =   285
         Width           =   2145
      End
      Begin VB.Label lblPrompt 
         Caption         =   "新密码校验:"
         Height          =   210
         Index           =   3
         Left            =   255
         TabIndex        =   8
         Top             =   1230
         Width           =   1080
      End
      Begin VB.Label lblPrompt 
         Caption         =   "新密码:"
         Height          =   210
         Index           =   2
         Left            =   255
         TabIndex        =   7
         Top             =   765
         Width           =   765
      End
      Begin VB.Label lblPrompt 
         Caption         =   "原密码:"
         Height          =   210
         Index           =   1
         Left            =   255
         TabIndex        =   6
         Top             =   345
         Width           =   765
      End
   End
   Begin VB.Label lblPrompt 
      Caption         =   "编号:"
      Height          =   210
      Index           =   4
      Left            =   150
      TabIndex        =   12
      Top             =   195
      Width           =   540
   End
   Begin VB.Label lblPrompt 
      Caption         =   "姓名:"
      Height          =   210
      Index           =   0
      Left            =   2115
      TabIndex        =   10
      Top             =   195
      Width           =   540
   End
End
Attribute VB_Name = "frmMMGL_Input"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Public strEID As String           '编号
Public strName As String            '姓名
Dim blnEditFlag As Boolean          '编辑标志,当对内容做任何改动时,该变量置为True

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
    Dim strSQL As String
    Dim strMM As String
    
    '合理性检测
    If Trim(Me.txtNewMM.Text) = "" Then
        Warning "新密码没有输入,请先输入新密码!!!"
        Me.txtNewMM.SetFocus
        Exit Sub
    End If
    If Len(Trim(Me.txtNewMM.Text)) < 3 Then
        Warning "密码位数为3--6位!!!"
        Me.txtNewMM.SetFocus
        Exit Sub
    End If
    If Trim(Me.txtNewMMJY.Text) <> Trim(Me.txtNewMM.Text) Then
        Warning "两次输入的新密码不相同,请仔细核对!!!"
        Me.txtNewMMJY.SetFocus
        Exit Sub
    End If
    
    '修改密码
    strMM = Cipher(Trim(Me.txtNewMM.Text))
    strSQL = "update Employee set MM= '" & strMM & "' where EID='" & strEID & "'"
    On Error GoTo ErrHandle
    gConnect.Execute strSQL
    On Error GoTo 0
    Unload Me
    Exit Sub
    
ErrHandle:
    Warning "密码修改失败!!!" & Chr(13) & Err.Description
    On Error GoTo 0
    Unload Me
End Sub

Private Sub Form_Load()
    Me.txtEID.Text = strEID
    Me.txtName.Text = strName
    Me.cmdOK.Enabled = False
End Sub

Private Sub txtOldMM_GotFocus()
    Call AutoSelectText(txtOldMM)
End Sub

Private Sub txtOldMM_KeyPress(KeyAscii As Integer)
    Call IfEnterKeyMoveNext(KeyAscii)
End Sub

Private Sub txtNewMM_GotFocus()
    Call AutoSelectText(txtNewMM)
End Sub

Private Sub txtNewMM_KeyPress(KeyAscii As Integer)
    Call IfEnterKeyMoveNext(KeyAscii)
End Sub

Private Sub txtNewMMJY_GotFocus()
    Call AutoSelectText(txtNewMMJY)
End Sub

Private Sub txtNewMMJY_KeyPress(KeyAscii As Integer)
    Call IfEnterKeyMoveNext(KeyAscii)
End Sub

Private Sub txtOldMM_LostFocus()
    Dim blnOK As Boolean  '原密码校验正确
    Dim strSQL As String
    Dim strMM As String
    
    blnOK = False
    strSQL = "select MM from Employee where EID='" & strEID & "'"
    strMM = Trim(gConnect.Execute(strSQL).Fields(0))
    If strMM = "" Then
        If Trim(Me.txtOldMM.Text) = "" Then blnOK = True
    ElseIf Trim(Me.txtOldMM.Text) <> "" Then
        If strMM = Cipher(Trim(Me.txtOldMM.Text)) Then blnOK = True
    End If
    If blnOK = False Then
        Me.cmdOK.Enabled = False
        Me.txtNewMM.Text = ""
        Me.txtNewMMJY.Text = ""
        Me.txtNewMM.Enabled = False
        Me.txtNewMMJY.Enabled = False
        If Trim(Me.txtOldMM.Text) <> "" Then
            Warning ("密码输入错误!!!")
        End If
    Else
        Me.cmdOK.Enabled = True
        Me.txtNewMM.Enabled = True
        Me.txtNewMMJY.Enabled = True
        Me.txtNewMM.SetFocus
    End If
End Sub

⌨️ 快捷键说明

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