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

📄 fmsweep.frm

📁 <Visual Basic 数据库开发实例精粹(第二版)>一书首先介绍了Visual Basic(简称VB)开发的技巧和重点技术
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FMSweep 
   Caption         =   "打扫"
   ClientHeight    =   1920
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4050
   LinkTopic       =   "Form1"
   ScaleHeight     =   1920
   ScaleWidth      =   4050
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton ComdCancel 
      Caption         =   "取消"
      Height          =   495
      Left            =   2280
      TabIndex        =   3
      Top             =   1200
      Width           =   855
   End
   Begin VB.CommandButton ComdOK 
      Caption         =   "确定"
      Height          =   495
      Left            =   720
      TabIndex        =   2
      Top             =   1200
      Width           =   855
   End
   Begin VB.ComboBox CombRoomID 
      Height          =   315
      Left            =   2040
      TabIndex        =   1
      Top             =   480
      Width           =   1455
   End
   Begin VB.Label LabelDate 
      Height          =   255
      Left            =   3000
      TabIndex        =   4
      Top             =   120
      Width           =   975
   End
   Begin VB.Label Label1 
      Caption         =   "房间编号:"
      Height          =   375
      Left            =   600
      TabIndex        =   0
      Top             =   600
      Width           =   1095
   End
End
Attribute VB_Name = "FMSweep"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub ComdCancel_Click()
  Unload Me
End Sub

Private Sub ComdOK_Click()
  Dim Str As String

  If Me.CombRoomID.Text = "" Then
    MsgBox "请选择房间编号!"
    Exit Sub
  End If
    
  Str = "update RoomInfo set RoomState='打扫' where RoomID='" & Trim(Me.CombRoomID.Text) & "'"
  g_DBConn.Execute Str
  Unload Me
End Sub

Private Sub Form_Load()
  Me.Top = (Screen.Height - Me.Height) / 2    '垂直方向居中
  Me.Left = (Screen.Width - Me.Height) / 2    '水平方向居中
    
  Me.LabelDate.Caption = Date
    
  '从数据库中读取数据写入房间编号下拉列表框
  Dim adoRs As New ADODB.Recordset
   Dim DBStr As String
 DBStr = "select RoomID from RoomInfo"
  adoRs.Open DBStr, g_DBConn, adOpenStatic, adLockReadOnly

  If adoRs.RecordCount > 0 Then
    adoRs.MoveFirst

    Do While Not adoRs.EOF
      CombRoomID.AddItem adoRs.Fields(0).Value
      adoRs.MoveNext
    Loop

  End If

  adoRs.Close
  Set adoRs = Nothing
End Sub

⌨️ 快捷键说明

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