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

📄 kfzt.frm

📁 酒店管理系统 主要是实现了酒店的客房管理
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form kfztt 
   Caption         =   "房间状态"
   ClientHeight    =   5610
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   6150
   LinkTopic       =   "Form3"
   ScaleHeight     =   5610
   ScaleWidth      =   6150
   StartUpPosition =   2  '屏幕中心
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   615
      Left            =   6240
      Top             =   2280
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   1085
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   2
      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=KFGL.MDB;Persist Security Info=False"
      OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=KFGL.MDB;Persist Security Info=False"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "kf"
      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 Frame2 
      Height          =   735
      Left            =   0
      TabIndex        =   4
      Top             =   4800
      Width           =   6015
      Begin VB.CommandButton Command1 
         Caption         =   "退出"
         Height          =   495
         Left            =   4680
         TabIndex        =   11
         Top             =   120
         Width           =   1335
      End
      Begin VB.Label Label10 
         Caption         =   "Label10"
         ForeColor       =   &H000000FF&
         Height          =   375
         Left            =   1680
         TabIndex        =   16
         Top             =   240
         Width           =   615
      End
      Begin VB.Label Label9 
         Caption         =   "预定:"
         Height          =   255
         Left            =   1200
         TabIndex        =   15
         Top             =   240
         Width           =   615
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         Caption         =   "Label7"
         ForeColor       =   &H000000FF&
         Height          =   180
         Left            =   4080
         TabIndex        =   10
         Top             =   240
         Width           =   540
      End
      Begin VB.Label Label6 
         Caption         =   "使用率:"
         Height          =   375
         Left            =   3360
         TabIndex        =   9
         Top             =   240
         Width           =   615
      End
      Begin VB.Label Label5 
         Caption         =   "Label5"
         ForeColor       =   &H000000FF&
         Height          =   375
         Left            =   2760
         TabIndex        =   8
         Top             =   240
         Width           =   735
      End
      Begin VB.Label Label4 
         Caption         =   "空闲:"
         Height          =   375
         Left            =   2280
         TabIndex        =   7
         Top             =   240
         Width           =   855
      End
      Begin VB.Label Label3 
         Caption         =   "Label3"
         ForeColor       =   &H000000FF&
         Height          =   375
         Left            =   600
         TabIndex        =   6
         Top             =   240
         Width           =   855
      End
      Begin VB.Label Label2 
         Caption         =   "入住:"
         Height          =   375
         Left            =   120
         TabIndex        =   5
         Top             =   240
         Width           =   855
      End
   End
   Begin VB.Frame Frame1 
      Height          =   4815
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   6015
      Begin VB.CommandButton Command3 
         Caption         =   "查看"
         Height          =   495
         Left            =   2400
         TabIndex        =   13
         Top             =   120
         Width           =   1335
      End
      Begin VB.CommandButton Command2 
         Caption         =   "显示所有房间"
         Height          =   495
         Left            =   4560
         TabIndex        =   12
         Top             =   120
         Width           =   1335
      End
      Begin MSDataGridLib.DataGrid DataGrid1 
         DragMode        =   1  'Automatic
         Height          =   3975
         Left            =   120
         TabIndex        =   2
         Top             =   600
         Width           =   5775
         _ExtentX        =   10186
         _ExtentY        =   7011
         _Version        =   393216
         AllowUpdate     =   0   'False
         HeadLines       =   1
         RowHeight       =   15
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   2
         BeginProperty Column00 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
            EndProperty
            BeginProperty Column01 
            EndProperty
         EndProperty
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         ItemData        =   "kfzt.frx":0000
         Left            =   600
         List            =   "kfzt.frx":0002
         TabIndex        =   1
         Top             =   240
         Width           =   1695
      End
      Begin VB.Label Label1 
         Caption         =   "类别:"
         Height          =   375
         Left            =   120
         TabIndex        =   3
         Top             =   240
         Width           =   975
      End
   End
   Begin VB.Label Label8 
      Caption         =   "Label8"
      Height          =   495
      Left            =   6720
      TabIndex        =   14
      Top             =   600
      Width           =   1335
   End
End
Attribute VB_Name = "kfztt"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Unload Me
End Sub

Private Sub Command2_Click()
Set DataGrid1.DataSource = Adodc1
End Sub

Private Sub Command3_Click()
If Combo1.Text = "" Then
   MsgBox "请选择您要查询的类别", vbOKOnly + vbExclamation, "错误"
   Exit Sub
End If
Dim sql As String
Dim rs_find As New ADODB.Recordset
Dim conn As String
conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=kfgl.mdb;Persist Security Info=False"
sql = "select * from kf where 类别='" & Combo1.Text & "'"


   DataGrid1.AllowUpdate = True
   rs_find.CursorLocation = adUseClient
   rs_find.Open sql, conn, adOpenKeyset, adLockPessimistic
   
   DataGrid1.AllowUpdate = False
   
If rs_find.EOF Then
   MsgBox "对不起!" + Chr(10) + "没有您要查找的记录", vbOKOnly + vbExclamation, "失败"
   Exit Sub
End If

   Set DataGrid1.DataSource = rs_find
End Sub

Private Sub Form_Activate()
Adodc1.Refresh

End Sub

Private Sub Form_Load()
Dim m As Integer
Dim n As Integer
Combo1.AddItem "单人间"
Combo1.AddItem "双人间"
Combo1.AddItem "四人间"
Combo1.AddItem "豪华间"
Dim sql1 As String
Dim sql2 As String
Dim sql3 As String
Dim sql4 As String
Dim rs_find1 As New ADODB.Recordset
Dim rs_find2 As New ADODB.Recordset
Dim rs_find3 As New ADODB.Recordset
Dim rs_find4 As New ADODB.Recordset
Dim conn1 As String
conn1 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=kfgl.mdb;Persist Security Info=False"
sql1 = "select * from kf where 状态='入住'"


  
   rs_find1.CursorLocation = adUseClient
   rs_find1.Open sql1, conn1, adOpenKeyset, adLockPessimistic
   
Label3.Caption = rs_find1.RecordCount
sql2 = "select * from kf where 状态='空房'"


  
   rs_find2.CursorLocation = adUseClient
   rs_find2.Open sql2, conn1, adOpenKeyset, adLockPessimistic
   
Label5.Caption = rs_find2.RecordCount
sql3 = "select * from kf"
   rs_find3.CursorLocation = adUseClient
   rs_find3.Open sql3, conn1, adOpenKeyset, adLockPessimistic
   Label8.Caption = rs_find3.RecordCount
sql4 = "select * from kf where 状态='预定'"


  
   rs_find4.CursorLocation = adUseClient
   rs_find4.Open sql4, conn1, adOpenKeyset, adLockPessimistic
   
Label10.Caption = rs_find4.RecordCount

Label7.Caption = Label3.Caption / Label8.Caption * 100 & "%"   '客房使用率
Set DataGrid1.DataSource = Adodc1
   
End Sub

⌨️ 快捷键说明

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