setpasswd.frm

来自「星级酒店客房管理系统一套很不错的系统」· FRM 代码 · 共 232 行

FRM
232
字号
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form setpasswd 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "【修改口令】"
   ClientHeight    =   1710
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5790
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "setpasswd.frx":0000
   ScaleHeight     =   1710
   ScaleWidth      =   5790
   StartUpPosition =   2  '屏幕中心
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   3720
      Top             =   45
      Visible         =   0   'False
      Width           =   1365
      _ExtentX        =   2408
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=LCHOTEL"
      OLEDBString     =   "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=LCHOTEL"
      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.Frame Frame1 
      Height          =   1530
      Left            =   105
      TabIndex        =   0
      Top             =   60
      Width           =   5580
      Begin VB.CommandButton Command2 
         Height          =   375
         Left            =   3990
         Picture         =   "setpasswd.frx":1BD9
         Style           =   1  'Graphical
         TabIndex        =   5
         Top             =   855
         Width           =   1000
      End
      Begin VB.CommandButton Command1 
         Enabled         =   0   'False
         Height          =   375
         Left            =   3990
         Picture         =   "setpasswd.frx":2A2B
         Style           =   1  'Graphical
         TabIndex        =   4
         Top             =   420
         Width           =   1000
      End
      Begin VB.TextBox Text3 
         Appearance      =   0  'Flat
         Height          =   300
         IMEMode         =   3  'DISABLE
         Left            =   1680
         PasswordChar    =   "*"
         TabIndex        =   3
         Top             =   1020
         Width           =   1500
      End
      Begin VB.TextBox Text2 
         Appearance      =   0  'Flat
         Height          =   300
         IMEMode         =   3  'DISABLE
         Left            =   1680
         PasswordChar    =   "*"
         TabIndex        =   2
         Top             =   690
         Width           =   1500
      End
      Begin VB.TextBox Text1 
         Appearance      =   0  'Flat
         BackColor       =   &H00C0E0FF&
         Height          =   300
         IMEMode         =   3  'DISABLE
         Left            =   1680
         PasswordChar    =   "*"
         TabIndex        =   1
         Top             =   300
         Width           =   1500
      End
      Begin VB.Label Label3 
         Caption         =   "验证新口令:"
         Height          =   285
         Left            =   360
         TabIndex        =   8
         Top             =   1080
         Width           =   1110
      End
      Begin VB.Label Label2 
         Caption         =   "新口令:"
         Height          =   240
         Left            =   375
         TabIndex        =   7
         Top             =   735
         Width           =   1140
      End
      Begin VB.Label Label1 
         Caption         =   "旧口令:"
         Height          =   270
         Left            =   375
         TabIndex        =   6
         Top             =   345
         Width           =   990
      End
   End
End
Attribute VB_Name = "setpasswd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click()
If Text1.Text <> "" And Text2.Text <> "" And Text3.Text <> "" Then

      If Text2.Text <> Text3.Text Then
            MsgBox "请注意:新口令二次验证不符!重新输入。", vbOKOnly, "提示"
            Text2.SetFocus
        Else
    Adodc1.Recordset.Fields("密码") = Text3.Text
    Adodc1.Recordset.Update
    MsgBox "恭喜您:口令修改成功!", vbOKOnly, "提示"
    Adodc1.Recordset.Close
    Unload Me
    End If
Else
  MsgBox "请注意:信息不完整,请重新输入。", vbOKOnly, "提示"
        Me.Text1.SetFocus
End If
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub
Private Sub Form_Load()
    Adodc1.ConnectionString = My_PROVIDER
    Adodc1.CommandType = adCmdText
    
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
    Dim strFind As String
    If KeyAscii = Asc(Chr(13)) Then
    Adodc1.RecordSource = "select * from 权限信息表 where 操作员 like '" & CzyName & "' and 密码 like '" & Me.Text1.Text & "'"
    Adodc1.Refresh
        If Adodc1.Recordset.RecordCount <> 0 Then
            Me.Text2.SetFocus
        Else
            MsgBox "请注意:旧口令不对!重新输入。", vbOKOnly, "提示"
        End If
    
    End If
End Sub

Private Sub Text1_LostFocus()
    Dim strFind As String
        Adodc1.RecordSource = "select * from 权限信息表 where  操作员 like '" & CzyName & "' and 密码 like '" & Me.Text1.Text & "'"
        Adodc1.Refresh
        If Adodc1.Recordset.RecordCount <> 0 Then
            Me.Text2.SetFocus
             Command1.Enabled = True
        Else
            MsgBox "请注意:旧口令不对!重新输入。", vbOKOnly, "提示"
            Me.Text1.SetFocus
        End If
    
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
    If KeyAscii = Asc(Chr(13)) Then
            If IsNull(Text2) Or Text2 = "" Then
                MsgBox "请注意:口令不能为空!", 48, "提示"
                Text2.SetFocus
            Else
                Text3.SetFocus
            End If
    End If
End Sub


Private Sub Text3_KeyPress(KeyAscii As Integer)
    If KeyAscii = Asc(Chr(13)) Then
        If Text2.Text <> Text3.Text Then
            MsgBox "请注意:新口令二次验证不符!重新输入。", vbOKOnly, "提示"
            Text2.SetFocus
        Else
            Command1.Enabled = True
            Command1.SetFocus
        End If
    End If
End Sub

⌨️ 快捷键说明

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