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

📄 frm_edit_password.frm

📁 是一款专业的销售管理软件
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frm_Edit_Password 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "密码修改"
   ClientHeight    =   2325
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4110
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2325
   ScaleWidth      =   4110
   ShowInTaskbar   =   0   'False
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   120
      Top             =   2640
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   1
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      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.CommandButton Command2 
      Caption         =   "取消"
      Height          =   375
      Left            =   3100
      TabIndex        =   3
      Top             =   1920
      Width           =   975
   End
   Begin VB.Frame Frame1 
      Height          =   1815
      Left            =   50
      TabIndex        =   1
      Top             =   0
      Width           =   4020
      Begin VB.TextBox Text5 
         Height          =   300
         Left            =   1320
         TabIndex        =   0
         Top             =   240
         Width           =   2535
      End
      Begin VB.TextBox Text3 
         Height          =   300
         IMEMode         =   3  'DISABLE
         Left            =   1320
         PasswordChar    =   "*"
         TabIndex        =   9
         Top             =   1320
         Width           =   2535
      End
      Begin VB.TextBox Text2 
         Height          =   300
         IMEMode         =   3  'DISABLE
         Left            =   1320
         PasswordChar    =   "*"
         TabIndex        =   8
         Top             =   960
         Width           =   2535
      End
      Begin VB.TextBox Text1 
         Height          =   300
         IMEMode         =   3  'DISABLE
         Left            =   1320
         PasswordChar    =   "*"
         TabIndex        =   7
         Top             =   600
         Width           =   2535
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "请输入用户名"
         Height          =   180
         Left            =   120
         TabIndex        =   10
         Top             =   315
         Width           =   1080
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "请确认新密码"
         Height          =   180
         Left            =   120
         TabIndex        =   6
         Top             =   1395
         Width           =   1080
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "请输入新密码"
         Height          =   180
         Left            =   120
         TabIndex        =   5
         Top             =   1035
         Width           =   1080
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "请输入旧密码"
         Height          =   180
         Left            =   120
         TabIndex        =   4
         Top             =   675
         Width           =   1080
      End
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确认"
      Height          =   375
      Left            =   2040
      TabIndex        =   2
      Top             =   1920
      Width           =   975
   End
End
Attribute VB_Name = "frm_Edit_Password"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click()
    rtn = SetWindowPos(Me.hwnd, -2, 0, 0, 0, 0, 3)      '运用API函数SetWindowPos,来实现取消窗体置前的功能
    Call Main
    If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text5.Text = "" Then
        MsgBox "输入不能为空!!", 48, "提示信息"
    Else
        '判断输入的用户名在数据库中是否存在
        Adodc1.RecordSource = "select * from tb_enter where M_Password ='" & Text1.Text & "' and M_name='" + Text5.Text + "'"
        Adodc1.Refresh
        If Adodc1.Recordset.RecordCount > 0 Then
            If Text2.Text <> Text3.Text Then                                  '判断数据的密码是否正确
                MsgBox "两次输入的密码不一致,请您确认后重新输入", 48, "提示信息"
                Text2.Text = ""
                Text3.Text = ""
                Text2.SetFocus
            Else
                '如果输入正确的密码则修改密码
                Set adoRs = adoCon.Execute("UPDATE tb_enter SET M_Password= '" + Text3.Text + "' where M_name='" + Text5.Text + "'")
                Adodc1.Refresh
                MsgBox "密码修改成功,请您记住新密码", , "信息提示"
                Unload Me
            End If
        Else
            MsgBox "没有此用户的信息,请您确认后重新输入", 48, "信息提示"
            Text1.Text = ""
            Text2.Text = ""
            Text3.Text = ""
            Text5.Text = ""
            Text5.SetFocus
        End If
    End If
    adoCon.Close
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub

Private Sub Form_Load()
    rtn = SetWindowPos(Me.hwnd, -1, 0, 0, 0, 0, 3)      '运用API函数SetWindowPos,来实现使窗体置前的功能
    '通过代码连接数据库
    Adodc1.ConnectionString = CnnStr
    Adodc1.RecordSource = "select * from tb_enter"      '连接操作员信息数据表
    Adodc1.Refresh
    Me.Left = (Screen.Width - Me.Width) / 2             '使窗体居中
    Me.Top = (Screen.Height - Me.Height) / 2
End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then              '如果按下的是回车键,则光标落到文本框当中
        Text2.SetFocus
    End If
End Sub

Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then             '如果按下的是回车键,则光标落到文本框当中
        Text3.SetFocus
    End If
End Sub

Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then          '如果按下的是回车键,则调用按钮单击过程
        Call Command1_Click
    End If
End Sub

Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then           '如果按下的是回车键,则光标落到文本框当中
        Text1.SetFocus
    End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
    frm_main.Enabled = True
End Sub

⌨️ 快捷键说明

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