📄 ydrz.frm
字号:
Left = 240
TabIndex = 12
Top = 2640
Width = 810
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "从何处来:"
Height = 180
Left = 240
TabIndex = 11
Top = 3120
Width = 810
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "到何处去:"
Height = 180
Left = 2400
TabIndex = 10
Top = 3120
Width = 810
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "住宿原因:"
Height = 180
Left = 240
TabIndex = 9
Top = 3600
Width = 810
End
Begin VB.Label Label13
AutoSize = -1 'True
Caption = "操作员:"
Height = 180
Left = 240
TabIndex = 8
Top = 4680
Width = 630
End
Begin VB.Label Label14
AutoSize = -1 'True
Caption = "入住日期:"
Height = 180
Left = 240
TabIndex = 7
Top = 4200
Width = 810
End
Begin VB.Label Label15
AutoSize = -1 'True
Caption = "入住时间:"
Height = 180
Left = 2520
TabIndex = 6
Top = 4200
Width = 810
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 495
Left = 8880
Top = 960
Width = 1335
_ExtentX = 2355
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=KFGL.MDB;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=KFGL.MDB;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "yd"
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 VB.Frame Frame1
Caption = "预定信息"
Height = 5175
Left = 120
TabIndex = 0
Top = 120
Width = 3255
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "ydrz.frx":0000
Height = 4815
Left = 120
TabIndex = 1
Top = 240
Width = 3015
_ExtentX = 5318
_ExtentY = 8493
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
End
Attribute VB_Name = "ydrzz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim rs_bookstyle As New ADODB.Recordset
Dim rs_bookstyle1 As New ADODB.Recordset
Dim rs_bookstyle2 As New ADODB.Recordset
Dim conn As String
conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=kfgl.mdb;Persist Security Info=False"
Dim sql As String
Dim sql1 As String
Dim sql2 As String
If Text1.Text = "" Then
MsgBox "证件地址不能为空!", vbOKOnly + vbExclamation, "错误"
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "从何处来不能为空!", vbOKOnly + vbExclamation, "错误"
Exit Sub
End If
If Text3.Text = "" Then
MsgBox "到何处去不能为空!", vbOKOnly + vbExclamation, "错误"
Exit Sub
End If
If Text4.Text = "" Then
MsgBox "住宿原因不能为空!", vbOKOnly + vbExclamation, "错误"
Exit Sub
End If
sql = "select * from djb where 房号='" & Label4.Caption & "'"
sql1 = "select * from kf where 房号='" & Label4.Caption & "'"
sql2 = "select * from yd where 房号='" & Label4.Caption & "'"
rs_bookstyle.Open sql, conn, adOpenKeyset, adLockPessimistic
rs_bookstyle1.Open sql1, conn, adOpenKeyset, adLockPessimistic
rs_bookstyle2.Open sql2, conn, adOpenKeyset, adLockPessimistic
If rs_bookstyle1.Fields(3) = "预定" Then
rs_bookstyle.AddNew
rs_bookstyle.Fields(0) = Trim(Label4.Caption)
rs_bookstyle.Fields(1) = Trim(Label19.Caption)
rs_bookstyle.Fields(2) = Trim(Label17.Caption)
' rs_bookstyle.Fields(3) = Trim(Text4.Text)
rs_bookstyle.Fields(4) = Trim(Label18.Caption)
rs_bookstyle.Fields(5) = Trim(Label16.Caption)
rs_bookstyle.Fields(6) = Trim(Label20.Caption)
rs_bookstyle.Fields(7) = Trim(Label21.Caption)
rs_bookstyle.Fields(8) = Trim(Text1.Text)
rs_bookstyle.Fields(9) = Trim(Text2.Text)
rs_bookstyle.Fields(10) = Trim(Text3.Text)
rs_bookstyle.Fields(11) = Trim(Text4.Text)
rs_bookstyle.Fields(12) = Trim(Label22.Caption)
rs_bookstyle.Fields(13) = Trim(DTP1.Value)
rs_bookstyle.Fields(14) = Trim(tim1.Value)
rs_bookstyle.Fields(15) = "0"
rs_bookstyle.Fields(16) = "0"
rs_bookstyle.Fields(17) = "0"
rs_bookstyle.Update
MsgBox "订房成功!", vbOKOnly, ""
rs_bookstyle2.Delete
' re_bookstyle2.Update
' re_bookstyle2.Close
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
DTP1.Value = Date
tim1.Value = Time
Adodc1.Refresh
rs_bookstyle.Close
Else
MsgBox "房间状态发生错误!", vbOKOnly + vbExclamation, ""
rs_bookstyle.Close
Exit Sub
End If
rs_bookstyle1.Fields(3) = "入住"
rs_bookstyle1.Update
'rs_bookstybe1.Close
Adodc1.Refresh
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
DTP1.Value = Date
tim1.Value = Time
Adodc1.Refresh
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Adodc1.Refresh
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
DTP1.Value = Date
tim1.Value = Time
Label20.Caption = "身份证"
Label22.Caption = MDIForm1.StatusBar1.Panels(1).Text
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -