?? setroom1.frm
字號:
Height = 300
Left = 630
TabIndex = 1
Top = 420
Width = 840
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 2130
Top = 885
Visible = 0 'False
Width = 1635
_ExtentX = 2884
_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 = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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
End
Attribute VB_Name = "setroom1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'星級酒店管理系統最初功能演示版,提供所有星級酒店管理中的客房管理,
'房態管理,客史管理,客人資料管理,帳務管理,報表管理,餐飲收費管理
'菜譜管理,夜審處理,數據庫備份等功能.所有功能皆可以運行,(但有一些BUG未處理)
'此代碼完全可以完成星級酒店上述管理功能.(提供者:帥)
'--------------------------------------------------------------
'代碼編寫于:2001.12 系統分析:帥 代碼編寫:帥 版權所有:帥
'--------------------------------------------------------------
'本份代碼僅提供給程序太平洋的所有朋友學習,研究之用.
'其它網站一律不得轉載,否則為侵權行為,本人保留法律追訴權力.
'這也是本人最早的VB版程序,代碼質量不好.望笑納.:)
'--------------------------------------------------------------
'提供日期:2003-05-31 提供者:帥
'--------------------------------------------------------------
'系統提從與ACCESS或SQL相接,在登錄時,選擇全局數據庫,就與SQL數據庫
'連接,字符串存放在SERVER.DAT文本文件中;選擇本地數據庫,與本地ACCESS
'數據庫相連,連接字符串存放在LOCAT.DAT文件中.(當前存放為e:\hotel2\room.mdb)
'---------------------------------------------------------------
'將ACCESS中所有表導入SQL中,并將有的表中的ID字段改為自動編碼,就可以使用.
'---------------------------------------------------------------------
'
'
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
Select Case RoomForm_Type
Case "增加"
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 客房"
Adodc1.Refresh
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("房號") = Me.Text1.Text
Adodc1.Recordset.Fields("樓號") = Me.Text2.Text
Adodc1.Recordset.Fields("層") = Me.Text3.Text
Adodc1.Recordset.Fields("日房價") = Me.Text4.Text
Adodc1.Recordset.Fields("床位數") = Me.Text5.Text
Adodc1.Recordset.Fields("類型") = Me.Combo1.Text
Adodc1.Recordset.Fields("當前狀態") = Me.Combo2.Text
Adodc1.Recordset.Fields("電話") = Me.Text7.Text
Adodc1.Recordset.Fields("出售方式") = Me.Text6.Text
Adodc1.Recordset.Update
Adodc1.Recordset.Close
Case "修改"
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 客房 where 房號 like '" & RoomNO & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 1 Then
Adodc1.Recordset.Fields("房號") = Me.Text1.Text
Adodc1.Recordset.Fields("樓號") = Me.Text2.Text
Adodc1.Recordset.Fields("層") = Me.Text3.Text
Adodc1.Recordset.Fields("日房價") = Me.Text4.Text
Adodc1.Recordset.Fields("床位數") = Me.Text5.Text
Adodc1.Recordset.Fields("類型") = Me.Combo1.Text
Adodc1.Recordset.Fields("當前狀態") = Me.Combo2.Text
Adodc1.Recordset.Fields("電話") = Me.Text7.Text
Adodc1.Recordset.Fields("出售方式") = Me.Text6.Text
Adodc1.Recordset.Update
Adodc1.Recordset.Close
Else
If Adodc1.Recordset.RecordCount > 1 Then
Adodc1.Recordset.MoveNext
Adodc1.Recordset.Fields("房號") = Me.Text1.Text
Adodc1.Recordset.Fields("樓號") = Me.Text2.Text
Adodc1.Recordset.Fields("層") = Me.Text3.Text
Adodc1.Recordset.Fields("日房價") = Me.Text4.Text
Adodc1.Recordset.Fields("床位數") = Me.Text5.Text
Adodc1.Recordset.Fields("類型") = Me.Combo1.Text
Adodc1.Recordset.Fields("當前狀態") = Me.Combo2.Text
Adodc1.Recordset.Fields("電話") = Me.Text7.Text
Adodc1.Recordset.Fields("出售方式") = Me.Text6.Text
Adodc1.Recordset.Update
Adodc1.Recordset.Close
Else
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("房號") = Me.Text1.Text
Adodc1.Recordset.Fields("樓號") = Me.Text2.Text
Adodc1.Recordset.Fields("層") = Me.Text3.Text
Adodc1.Recordset.Fields("日房價") = Me.Text4.Text
Adodc1.Recordset.Fields("床位數") = Me.Text5.Text
Adodc1.Recordset.Fields("類型") = Me.Combo1.Text
Adodc1.Recordset.Fields("當前狀態") = Me.Combo2.Text
Adodc1.Recordset.Fields("電話") = Me.Text7.Text
Adodc1.Recordset.Fields("出售方式") = Me.Text6.Text
Adodc1.Recordset.Update
Adodc1.Recordset.Close
End If
End If
End Select
Unload Me
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 項目編碼 where 編碼 like 'FL%' order by 名稱"
Adodc1.Refresh
While Not Adodc1.Recordset.EOF
Me.Combo1.AddItem Adodc1.Recordset.Fields("名稱")
If Adodc1.Recordset.Fields("首選項") = "是" Then
Me.Combo1.Text = Adodc1.Recordset.Fields("名稱")
End If
Adodc1.Recordset.MoveNext
Wend
Adodc1.Recordset.Close
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 房間狀態"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
While Not Adodc1.Recordset.EOF
Me.Combo2.AddItem Adodc1.Recordset.Fields("房間狀態")
Adodc1.Recordset.MoveNext
Wend
End If
Adodc1.Recordset.Close
Select Case RoomForm_Type
Case "增加"
Me.Label8.Caption = "增加客房"
Case "修改"
Me.Label8.Caption = "修改客房資料"
Me.Caption = "修改" & RoomNO & "客房資料"
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 客房 where 房號 like '" & RoomNO & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Me.Text1.Text = IIf(IsNull(Adodc1.Recordset.Fields("房號")), "", Adodc1.Recordset.Fields("房號"))
Me.Text2.Text = IIf(IsNull(Adodc1.Recordset.Fields("樓號")), "", Adodc1.Recordset.Fields("樓號"))
Me.Text3.Text = IIf(IsNull(Adodc1.Recordset.Fields("層")), "", Adodc1.Recordset.Fields("層"))
Me.Text4.Text = IIf(IsNull(Adodc1.Recordset.Fields("日房價")), 0, Adodc1.Recordset.Fields("日房價"))
Me.Text5.Text = IIf(IsNull(Adodc1.Recordset.Fields("床位數")), 0, Adodc1.Recordset.Fields("床位數"))
Me.Combo1.Text = IIf(IsNull(Adodc1.Recordset.Fields("類型")), 0, Adodc1.Recordset.Fields("類型"))
Me.Combo2.Text = IIf(IsNull(Adodc1.Recordset.Fields("當前狀態")), 0, Adodc1.Recordset.Fields("當前狀態"))
Else
MsgBox "操作錯誤:您沒有選擇要修改的房間!", 48, "提示"
Unload Me
End If
End Select
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -