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

📄 main_mima.frm

📁 酒店客房管理系统(vb^+SQLServer2000+使用说明)
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form main_Login 
   BackColor       =   &H8000000B&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "酒店客房管理系统"
   ClientHeight    =   3690
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6300
   Icon            =   "main_mima.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   Picture         =   "main_mima.frx":000C
   ScaleHeight     =   3690
   ScaleWidth      =   6300
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox Text2 
      Height          =   345
      IMEMode         =   3  'DISABLE
      Left            =   3165
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   2745
      Width           =   1860
   End
   Begin VB.TextBox Text1 
      Height          =   345
      IMEMode         =   3  'DISABLE
      Left            =   3165
      TabIndex        =   0
      Top             =   2355
      Width           =   1860
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   195
      Top             =   4020
      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         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\程序修改\宾馆客房管理系统\宾馆客房管理系统\DB_KFGL.mdb;Persist Security Info=False"
      OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\程序修改\宾馆客房管理系统\宾馆客房管理系统\DB_KFGL.mdb;Persist Security Info=False"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select * from tb_ma"
      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.Image Image2 
      Height          =   285
      Left            =   4260
      Picture         =   "main_mima.frx":4D698
      Top             =   3255
      Width           =   735
   End
   Begin VB.Image Image1 
      Height          =   285
      Left            =   3135
      Picture         =   "main_mima.frx":4E1D8
      Top             =   3270
      Width           =   735
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Height          =   315
      Left            =   2580
      TabIndex        =   2
      Top             =   2040
      Width           =   840
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Height          =   300
      Left            =   1620
      TabIndex        =   1
      Top             =   2055
      Width           =   825
   End
End
Attribute VB_Name = "main_Login"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim TIM As Integer     '定义一个整型变量
Dim myval As String     '定义一个字符串变量

Private Sub Form_Load()
    '自动识别数据库路径
    Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DB_KFGL.mdb;Persist Security Info=False"
    Adodc1.RecordSource = "select * from tb_user "
    Adodc1.Refresh
    End Sub
Private Sub Form_Activate()
    '当记录为零时,进入系统具有所有权限
    If Adodc1.Recordset.RecordCount = 0 Then
        MsgBox "请先设置操作员密码和权限!", , "系统提示"
        Load Main
        Main.Show
        Unload Me
    Else
        Text1.SetFocus
    End If
End Sub

Private Sub Image1_Click()
Static itimes As Integer
    Main.StatusBar1.Panels(4).text = Text1.text     '赋值给main.StatusBar1.Panels(4).Text
    '验证操作员及密码
    Adodc1.RecordSource = "select * from tb_user where 操作员='" + Text1.text + "'"
    Adodc1.Refresh
    If Adodc1.Recordset.RecordCount > 0 Then '如果记录数大于零
        '验证密码
        If Text2.text = Adodc1.Recordset.Fields("密码") Then
            Load Main
            Main.Show
            Unload Me
        Else
            If Text2.text <> Adodc1.Recordset.Fields("密码") Then
                MsgBox "密码错误,请重新输入!", vbCritical, "系统提示"
                itimes = itimes + 1
                Text2.text = ""
                Text2.SetFocus
            End If
        End If

    Else
        MsgBox "操作员不存在,请重新输入!", vbCritical, "系统提示"
        itimes = itimes + 1
        Text1.text = ""
        Text2.text = ""
        Text1.SetFocus
    End If
    If itimes = 3 Then     '错误3次,退出系统
        MyMsg = MsgBox("输入错误,请向系统管理员查询!", vbCritical, "系统提示")
        If MyMsg = vbOK Then End
    End If
End Sub

Private Sub Image2_Click()
End
End Sub

Private Sub text2_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn Then Image1_Click  '按回车键进入
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn Then Text2.SetFocus     '按回车键,text2获得焦点
End Sub

⌨️ 快捷键说明

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