📄 管理员.frm
字号:
VERSION 5.00
Begin VB.Form frmchushi
Caption = "系统初始化"
ClientHeight = 1245
ClientLeft = 60
ClientTop = 450
ClientWidth = 3510
LinkTopic = "Form1"
ScaleHeight = 1245
ScaleWidth = 3510
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "取消"
Height = 495
Left = 1800
TabIndex = 1
Top = 360
Width = 1215
End
Begin VB.CommandButton cmdchushi
Caption = "初始化"
Height = 495
Left = 240
TabIndex = 0
Top = 360
Width = 1215
End
End
Attribute VB_Name = "frmchushi"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rsguests As ADODB.Recordset
Dim rsroom As ADODB.Recordset
Dim rsroomstate As ADODB.Recordset
Private Sub cmdchushi_Click()
Set cnn = New ADODB.Connection
Dim connectstring As String
connectstring = "DSN=hotelodbc"
cnn.Open connectstring
Dim str As String
On Error GoTo err
cnn.BeginTrans
str = "delete from guests"
Debug.Print str
cnn.Execute str
str = "update roomstate set roomstate='r'"
Debug.Print str
cnn.Execute str
MsgBox "初始化成功", vbOKOnly + vbInformation, "提示"
cnn.CommitTrans
Exit Sub
err:
cnn.RollbackTrans
MsgBox "初始化失败", vbOKOnly + vbInformation, "提示"
Exit Sub
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -