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

📄 frmcodetableedit.frm

📁 是关于SQL的一些程序 很好很经典的~大家又兴趣的可以学习下
💻 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 frmCodeTableEdit 
   Caption         =   "代码修改"
   ClientHeight    =   4290
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   8025
   LinkTopic       =   "Form1"
   ScaleHeight     =   4290
   ScaleWidth      =   8025
   StartUpPosition =   3  '窗口缺省
   Begin MSDataGridLib.DataGrid DataGrid1 
      Bindings        =   "frmCodeTableEdit.frx":0000
      Height          =   2415
      Left            =   120
      TabIndex        =   6
      Top             =   1320
      Width           =   7635
      _ExtentX        =   13467
      _ExtentY        =   4260
      _Version        =   393216
      HeadLines       =   1
      RowHeight       =   15
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      DataMember      =   "CmdGetIDType"
      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 MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   900
      Top             =   3840
      Width           =   2355
      _ExtentX        =   4154
      _ExtentY        =   582
      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=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=酒店客房管理系统;Data Source=MOORE"
      OLEDBString     =   "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=酒店客房管理系统;Data Source=MOORE"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "Code_IDType"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Frame Frame1 
      Caption         =   "请选择代码表:"
      Height          =   915
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   7635
      Begin VB.OptionButton Option5 
         Caption         =   "客房级别"
         Height          =   495
         Left            =   6120
         TabIndex        =   5
         Top             =   300
         Width           =   1335
      End
      Begin VB.OptionButton Option4 
         Caption         =   "入住方式"
         Height          =   495
         Left            =   4800
         TabIndex        =   4
         Top             =   300
         Width           =   1395
      End
      Begin VB.OptionButton Option3 
         Caption         =   "工作单状态"
         Height          =   495
         Left            =   3060
         TabIndex        =   3
         Top             =   300
         Width           =   1575
      End
      Begin VB.OptionButton Option2 
         Caption         =   "客房状态"
         Height          =   495
         Left            =   1680
         TabIndex        =   2
         Top             =   300
         Width           =   1455
      End
      Begin VB.OptionButton Option1 
         Caption         =   "证件类别"
         Height          =   375
         Left            =   240
         TabIndex        =   1
         Top             =   360
         Width           =   1155
      End
   End
End
Attribute VB_Name = "frmCodeTableEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strCnn As String
Dim cnn As New Connection

Private Enum TableType
        Card = 1
        RoomState
        WorkSheetState
        MoveInMode
        RoomLevel
End Enum

Private Sub Form_Load()
        strCnn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial Catalog=酒店客房管理系统;Data Source=127.0.0.1"
        cnn.Open strCnn
        
        
End Sub

Private Sub BindGrid(t As TableType)
        Dim strSql As String
        strSql = ""
        
        On Error GoTo errHandle
                
        Select Case t
                Case TableType.Card:
                        strSql = "SELECT code AS 代码, description AS 描述 FROM Code_IDType"
                Case TableType.RoomState
                        strSql = "SELECT code AS 代码, descript AS 描述 From Code_RoomState"
                Case TableType.WorkSheetState
                        strSql = "SELECT code AS 代码, descript AS 描述 FROM Code_SheetStage"
                Case TableType.MoveInMode
                        strSql = "SELECT code AS 代码, descript AS 描述 FROM Code_MoveInMode"
                Case TableType.RoomLevel
                        strSql = "SELECT code AS 代码, descript AS 描述, price AS 价格, furnish AS 基本设施 From Code_RoomLevel"
        End Select
                
        Dim rs As New Recordset
        With rs
                .ActiveConnection = cnn
                .CursorLocation = adUseClient
                .Open strSql, , adOpenStatic, adLockReadOnly, adCmdText
        End With
        
        Set Adodc1.Recordset = rs
        
        Set DataGrid1.DataSource = Nothing
        DataGrid1.DataMember = ""
        DataGrid1.ClearFields
        Set DataGrid1.DataSource = Adodc1
        DataGrid1.Refresh
        
        Exit Sub
        
errHandle:
        MsgBox Err.Description
        
End Sub

Private Sub Form_Unload(Cancel As Integer)
        ' 关闭连接
        cnn.Close
        Set cnn = Nothing
End Sub

'
Private Sub Option1_Click()
        BindGrid (TableType.Card)
End Sub

Private Sub Option2_Click()
        BindGrid (TableType.RoomState)
End Sub

Private Sub Option3_Click()
        BindGrid (WorkSheetState)
End Sub

Private Sub Option4_Click()
        BindGrid (MoveInMode)
End Sub

Private Sub Option5_Click()
        BindGrid (RoomLevel)
End Sub

⌨️ 快捷键说明

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