📄 form1111111111111.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 8715
ClientLeft = 60
ClientTop = 450
ClientWidth = 11535
LinkTopic = "Form1"
ScaleHeight = 8715
ScaleWidth = 11535
StartUpPosition = 3 'Windows Default
Begin VB.TextBox Text2
Height = 975
Left = 4200
TabIndex = 2
Text = "Text2"
Top = 3840
Width = 3615
End
Begin VB.TextBox Text1
Height = 735
Left = 4200
TabIndex = 1
Text = "Text1"
Top = 2520
Width = 3495
End
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 1095
Left = 4320
TabIndex = 0
Top = 5760
Width = 2415
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim a As Integer
Dim b As Integer
a = 0
b = 0
'打开数据库
'根据实际设置数据库位置
'On Error GoTo errhanle
Set db = DBEngine.OpenDatabase(App.Path + "\db1.mdb")
Set rst = db.OpenRecordset("SELECT * FROM 订单 ", dbOpenDynaset)
While (Not rst.EOF)
If (rst!订单号 = Text15.Text And rst!身份证号 = Text16.Text) Then
a = 1
rst.Edit
rst.Delete
End If
rst.MoveNext
Wend
If (a = 0) Then
MsgBox "输入有误或没有该订单"
rst.Close
GoTo bb
End If
If (a = 1) Then
rst.Close
End If
Set db = DBEngine.OpenDatabase(App.Path + "\db1.mdb")
Set rst = db.OpenRecordset("SELECT * FROM 旅客", dbOpenDynaset)
While (Not rst.EOF)
If (rst.Fields(6) = Text11.Text And rst.Fields(4) = Text16.Text And a = 1) Then
rst.Edit
rst.Delete
b = 1
End If
rst.MoveNext
Wend
If (b = 0) Then
MsgBox "输入有误或没有该订单"
rst.Close
GoTo bb
End If
If (b = 1) Then
rst.Close
End If
Set db = DBEngine.OpenDatabase(App.Path + "\db1.mdb")
Set rst = db.OpenRecordset("SELECT * FROM 航班", dbOpenDynaset)
While (Not rst.EOF)
If (rst.Fields(0) = Form1.Label13.Caption And a = 1 And b = 1) Then
If (Combo2.Text = "头等舱") Then
rst.Edit
rst.Fields(10) = rst.Fields(10) + 1
rst.Update
Else
rst.Edit
rst.Fields(7) = rst.Fields(7) + 1
rst.Update
End If
End If
rst.MoveNext
Wend
MsgBox "已删除"
rst.Close
Set db = DBEngine.OpenDatabase(App.Path + "\db1.mdb")
Set rst = db.OpenRecordset("SELECT * FROM 意见", dbOpenDynaset)
rst.AddNew
rst!姓名 = Text5.Text
rst!身份证号 = Text12.Text
rst!意见 = Text17.Text
rst.Update
rst.Close
bb:
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -