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

📄 main_mmsz.frm

📁 宾馆客房管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form main_mmsz 
   BackColor       =   &H00FF8080&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "密码设置"
   ClientHeight    =   3555
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6360
   Icon            =   "main_mmsz.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "main_mmsz.frx":000C
   ScaleHeight     =   3555
   ScaleWidth      =   6360
   StartUpPosition =   1  '所有者中心
   Begin VB.TextBox txtnewpwd 
      BackColor       =   &H00FFFFFF&
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   2295
      MaxLength       =   6
      PasswordChar    =   "*"
      TabIndex        =   2
      Top             =   1950
      Width           =   2880
   End
   Begin VB.TextBox txtoldpwd 
      BackColor       =   &H00FFFFFF&
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   2280
      MaxLength       =   6
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   1380
      Width           =   2880
   End
   Begin VB.TextBox txtczy 
      BackColor       =   &H00FFFFFF&
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2280
      TabIndex        =   0
      Top             =   825
      Width           =   2880
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Height          =   465
      Left            =   4395
      TabIndex        =   4
      Top             =   2715
      Width           =   1560
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Height          =   465
      Left            =   2625
      TabIndex        =   3
      Top             =   2730
      Width           =   1560
   End
End
Attribute VB_Name = "main_mmsz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim DBcnn As New ADODB.Connection
Dim DBrs As New ADODB.Recordset
Dim sqlstr As String
Private Sub Form_Load()
 If DBcnn.State = 0 Then
    Dim connectstr As String
    connectstr = "Provider=Microsoft.jet.OLEDB.4.0;Data Source=" & _
               App.Path & "\KFGL.mdb;Persist Security Info=False"
    DBcnn.CursorLocation = adUseClient
    DBcnn.Open connectstr
 End If
 'sqlstr = "select * from qxsz"
 'DBrs.Open sqlstr, DBcnn, adOpenStatic, adLockBatchOptimistic
End Sub
Private Sub Form_Activate()
 'txtczy获得焦点
 txtczy.SetFocus
End Sub
Private Sub Form_Unload(Cancel As Integer)
 main.Enabled = True
End Sub
Private Sub txtczy_KeyDown(KeyCode As Integer, Shift As Integer)
 '回车txtoldpwd获得焦点
 If KeyCode = vbKeyReturn Then txtoldpwd.SetFocus
End Sub
Private Sub txtoldpwd_KeyDown(KeyCode As Integer, Shift As Integer)
 '回车txtnewpwd获得焦点
 If KeyCode = vbKeyReturn Then txtnewpwd.SetFocus
End Sub
'修改操作员密码
Private Sub label1_Click()
 sqlstr = "select * from qxsz where 操作员='" & txtczy.Text & "'"
 If DBrs.State = 1 Then
    DBrs.Close
 End If
 DBrs.Open sqlstr, DBcnn, adOpenStatic, adLockBatchOptimistic
 If DBrs.EOF Then
    MsgBox ("无此操作员,请重新输入!")
    Exit Sub
 End If
 If txtczy.Text <> "" And txtoldpwd.Text <> "" And txtoldpwd.Text = DBrs.Fields("密码") Then
 If txtnewpwd.Text <> "" Then
  DBrs.Fields("密码") = txtnewpwd.Text
  MsgBox ("密码修改成功,退出操作员密码修改!")
  DBrs.UpdateBatch adAffectCurrent
  main.Enabled = True
  Unload Me
 Else
  MsgBox ("请输入新密码!!")
 End If
 Else
 If txtczy.Text = "" Then
  MsgBox ("请输入操作员!")
  txtczy.SetFocus
 Else
  If txtczy.Text <> DBrs.Fields("操作员") Then
  txtczy.SetFocus
  txtczy.Text = ""
  MsgBox ("无此操作员,请重新输入!")
  End If
 End If
 If txtoldpwd.Text = "" Then
  MsgBox ("请输入操作员原密码!")
  txtoldpwd.SetFocus
 Else
  If txtoldpwd.Text <> DBrs.Fields("密码") Then
   MsgBox ("原密码错误,请重新输入原密码!")
   txtoldpwd.SetFocus
  End If
 End If
 End If
End Sub
Private Sub label2_Click()
 main.Enabled = True
 Unload Me
End Sub

⌨️ 快捷键说明

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