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

📄 frmaddroomtype.frm

📁 数据库课程设计
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmAddRoomType 
   Caption         =   "添加客房类型"
   ClientHeight    =   2790
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5025
   LinkTopic       =   "Form1"
   ScaleHeight     =   2790
   ScaleWidth      =   5025
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消(&C)"
      Height          =   375
      Left            =   2760
      TabIndex        =   9
      Top             =   2280
      Width           =   1215
   End
   Begin VB.CommandButton cmdAdd 
      Caption         =   "添加(&A)"
      Height          =   375
      Left            =   1200
      TabIndex        =   8
      Top             =   2280
      Width           =   1215
   End
   Begin VB.Frame Frame1 
      Caption         =   "客房类型信息"
      Height          =   1935
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   4815
      Begin VB.TextBox txtInfo 
         Height          =   975
         Index           =   2
         Left            =   840
         TabIndex        =   7
         Text            =   "Text3"
         Top             =   720
         Width           =   3855
      End
      Begin VB.TextBox txtInfo 
         Height          =   285
         Index           =   1
         Left            =   3000
         TabIndex        =   4
         Text            =   "Text2"
         Top             =   360
         Width           =   975
      End
      Begin VB.TextBox txtInfo 
         Height          =   285
         Index           =   0
         Left            =   840
         TabIndex        =   3
         Text            =   "Text1"
         Top             =   360
         Width           =   1455
      End
      Begin VB.Label Label4 
         Caption         =   "备注:"
         Height          =   255
         Left            =   240
         TabIndex        =   6
         Top             =   720
         Width           =   615
      End
      Begin VB.Label Label3 
         Caption         =   "(元)"
         Height          =   255
         Left            =   4080
         TabIndex        =   5
         Top             =   360
         Width           =   615
      End
      Begin VB.Label Label2 
         Caption         =   "价格:"
         Height          =   255
         Left            =   2400
         TabIndex        =   2
         Top             =   360
         Width           =   615
      End
      Begin VB.Label Label1 
         Caption         =   "名称:"
         Height          =   255
         Left            =   240
         TabIndex        =   1
         Top             =   360
         Width           =   615
      End
   End
End
Attribute VB_Name = "frmAddRoomType"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public msgText As String
Public sqlStr As String

Private Sub cmdAdd_Click()
   Dim rstRoomType As ADODB.Recordset
   
   If txtInfo(0).Text = "" Or txtInfo(1).Text = "" Then
   
      MsgBox "请将信息补充完整", vbOKOnly + vbExclamation, "警告"

      Exit Sub
   
   End If
   
    '添加新记录
    sqlStr = "select * from roomtype"
    Set rstRoomType = ExecuteSQL(sqlStr, msgText)
    rstRoomType.AddNew
    rstRoomType.Fields("typeName") = txtInfo(0).Text
    rstRoomType.Fields("price") = txtInfo(1).Text
    rstRoomType.Fields("memo") = txtInfo(2).Text
    rstRoomType.Update
    rstRoomType.Close
    
        
    MsgBox "房间添加完成!", vbOKOnly + vbExclamation, "警告"

End Sub

Private Sub cmdCancel_Click()
Unload Me
End Sub

Private Sub Form_Load()
txtInfo(0).Text = ""
txtInfo(1).Text = ""
txtInfo(2).Text = ""

End Sub

⌨️ 快捷键说明

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