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

📄 frmguestadd.frm

📁 该文件主要是关于SQL的数据库设计
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Height          =   310
         Left            =   840
         TabIndex        =   8
         Top             =   2280
         Width           =   1335
      End
      Begin VB.TextBox txt6 
         BackColor       =   &H8000000F&
         Enabled         =   0   'False
         Height          =   310
         Left            =   840
         TabIndex        =   6
         Top             =   1800
         Width           =   1815
      End
      Begin VB.TextBox txt5 
         Height          =   310
         Left            =   840
         TabIndex        =   5
         Top             =   1320
         Width           =   3255
      End
      Begin VB.TextBox txt4 
         Height          =   310
         Left            =   2160
         TabIndex        =   4
         Top             =   840
         Width           =   1935
      End
      Begin VB.TextBox txt3 
         Height          =   310
         Left            =   840
         TabIndex        =   3
         Top             =   840
         Width           =   615
      End
      Begin VB.TextBox txt1 
         Height          =   310
         Left            =   840
         TabIndex        =   1
         Top             =   360
         Width           =   1815
      End
      Begin VB.Label Label9 
         Caption         =   "押金"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   2400
         TabIndex        =   21
         Top             =   2400
         Width           =   375
      End
      Begin VB.Label Label8 
         Caption         =   "天数"
         Height          =   255
         Left            =   360
         TabIndex        =   20
         Top             =   2400
         Width           =   375
      End
      Begin VB.Label Label7 
         Caption         =   "时间"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   360
         TabIndex        =   19
         Top             =   1920
         Width           =   495
      End
      Begin VB.Label Label6 
         Caption         =   "住址"
         Height          =   255
         Left            =   360
         TabIndex        =   18
         Top             =   1440
         Width           =   375
      End
      Begin VB.Label Label5 
         Caption         =   "身份证"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   1560
         TabIndex        =   17
         Top             =   960
         Width           =   615
      End
      Begin VB.Label Label4 
         Caption         =   "年龄"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   360
         TabIndex        =   16
         Top             =   960
         Width           =   495
      End
      Begin VB.Label Label3 
         Caption         =   "性别"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   2760
         TabIndex        =   15
         Top             =   480
         Width           =   495
      End
      Begin VB.Label Label2 
         Caption         =   "姓名"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   360
         TabIndex        =   14
         Top             =   480
         Width           =   495
      End
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   360
      Top             =   6600
      Visible         =   0   'False
      Width           =   2040
      _ExtentX        =   3598
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      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=HotelRoom;Data Source=."
      OLEDBString     =   "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=HotelRoom;Data Source=."
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select Rnum from ViewEmptyRoomInfo order by Rnum ASC"
      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 MSAdodcLib.Adodc Adodc2 
      Height          =   330
      Left            =   2880
      Top             =   6600
      Visible         =   0   'False
      Width           =   1920
      _ExtentX        =   3387
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      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=HotelRoom;Data Source=."
      OLEDBString     =   "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=HotelRoom;Data Source=."
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select * from ViewEmptyRoomInfo"
      Caption         =   "Adodc2"
      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.Label Label1 
      Caption         =   "客 户 登 记"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   1800
      TabIndex        =   0
      Top             =   120
      Width           =   1455
   End
End
Attribute VB_Name = "frmGuestAdd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
txt6.Text = Trim(Now())
End Sub


Private Sub Command2_Click()
If txt1.Text = "" Or txt2.Text = "" Or txt3.Text = "" Or txt4.Text = "" Or txt6.Text = "" Or txt8.Text = "" Or DataCombo1.Text = "" Then
   MsgBox "请将蓝色部分填写完整!", vbInformation + vbOKOnly, "提示信息"
   If txt1.Text = "" Then
      txt1.SetFocus
   ElseIf txt2.Text = "" Then
      txt2.SetFocus
   ElseIf txt3.Text = "" Then
      txt3.SetFocus
   ElseIf txt4.Text = "" Then
      txt4.SetFocus
   ElseIf txt6.Text = "" Then
      txt6.SetFocus
   ElseIf txt8.Text = "" Then
      txt8.SetFocus
   ElseIf DataCombo1.Text = "" Then
      DataCombo1.SetFocus
   End If
Else
   Adodc3.RecordSource = "select Aid from ViewAdminInfo where Aname='" & frmLogin.DataCombo1.Text & "'"
   Adodc3.Refresh
   Dim aid As Integer
   aid = Adodc3.Recordset.Fields(0)
   
   Adodc4.RecordSource = "select * from GuestInfo"
   Adodc4.Refresh
   Adodc4.Recordset.AddNew
   Adodc4.Recordset.Fields("Cname") = txt1.Text
   Adodc4.Recordset.Fields("Csex") = txt2.Text
   Adodc4.Recordset.Fields("Cage") = txt3.Text
   Adodc4.Recordset.Fields("Cpnum") = txt4.Text
   If txt6.Text <> "" Then
      Adodc4.Recordset.Fields("Cadd") = txt5.Text
   End If
   Adodc4.Recordset.Fields("Cintime") = txt6.Text
   If txt7.Text <> "" Then
      Adodc4.Recordset.Fields("Cday") = txt7.Text
   End If
   Adodc4.Recordset.Fields("Cdeposit") = txt8.Text
   Adodc4.Recordset.Fields("Rnum") = DataCombo1.Text
   Adodc4.Recordset.Fields("Aid") = aid
   Adodc4.Recordset.Update
   frmMain.Adodc1.Refresh
   frmMain.DataGrid1.Refresh
   MsgBox "登记成功!", vbOKOnly + vbInformation, "提示信息"
   Unload Me
   
End If
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub DataCombo1_Change()
Adodc2.RecordSource = "select * from ViewEmptyRoomInfo where Rnum='" + Trim(DataCombo1.Text) + " '"
Adodc2.Refresh
Set DataGrid1.DataSource = Adodc2
DataGrid1.Refresh
End Sub

⌨️ 快捷键说明

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