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

📄 frm_pas.frm

📁 中小型企业员工管理系统 教程 教程 教程 教程 教程
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Frm_Pas 
   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
   StartUpPosition =   2  '屏幕中心
   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          =   315
      Left            =   1155
      TabIndex        =   3
      Top             =   1890
      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 
         Caption         =   "用户名"
         Height          =   255
         Left            =   120
         TabIndex        =   10
         Top             =   360
         Width           =   1095
      End
      Begin VB.Label Label3 
         Caption         =   "确认新密码"
         Height          =   255
         Left            =   120
         TabIndex        =   6
         Top             =   1440
         Width           =   1095
      End
      Begin VB.Label Label2 
         Caption         =   "新密码"
         Height          =   375
         Left            =   120
         TabIndex        =   5
         Top             =   1080
         Width           =   1095
      End
      Begin VB.Label Label1 
         Caption         =   "旧密码"
         Height          =   375
         Left            =   120
         TabIndex        =   4
         Top             =   720
         Width           =   1215
      End
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确认"
      Height          =   315
      Left            =   75
      TabIndex        =   2
      Top             =   1890
      Width           =   975
   End
End
Attribute VB_Name = "Frm_Pas"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click()
  If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text5.Text = "" Then
     MsgBox "输入不能为空!!", 48, "提示信息"
  Else
     '判断输入的用户名在数据库中是否存在
     Adodc1.RecordSource = "select * from 用户信息 where 密码 ='" & Text1.Text & "' and 用户名='" + 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 DB_AdoRs = Cnn.Execute("UPDATE 用户信息 SET 密码= '" + Text3.Text + "' where 用户名='" + 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
End Sub

Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
  '通过代码连接数据库
  Adodc1.ConnectionString = MyStrs
  Adodc1.RecordSource = "select * from 用户信息"      '连接操作员信息数据表
  Adodc1.Refresh
End Sub


⌨️ 快捷键说明

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