Set mrcc = ExecuteSQL(txtSQL, MsgText)
‘判断数据集对象是否为空
If Not mrcc.EOF Then
Do While Not mrcc.EOF
Combo1(1).AddItem mrcc.Fields(0)
mrcc.MoveNext
Loop
End If
‘关闭数据集对象
mrcc.Close
‘选择数据库中所有与舱位等级有关的信息
txtSQL = "select distinct serviceName from serviceInfo"
Set mrcc = ExecuteSQL(txtSQL, MsgText)
‘判断数据集对象是否为空
If Not mrcc.EOF Then
Do While Not mrcc.EOF
Combo1(2).AddItem mrcc.Fields(0)
mrcc.MoveNext
Loop
End If
‘关闭数据集对象
mrcc.Close
‘选择数据库中所有与客户姓名有关的信息
txtSQL = "select distinct customerName from customerInfo"
Set mrcc = ExecuteSQL(txtSQL, MsgText)
‘判断数据集对象是否为空
If Not mrcc.EOF Then
Do While Not mrcc.EOF
Combo1(4).AddItem mrcc.Fields(0)
mrcc.MoveNext
Loop
End If
‘关闭数据集对象
mrcc.Close
mblChange = False
End Sub
选择出发城市和到达城市,然后选择舱位类型,将自动显示票价,并用不可见文本框(txtairline、txtairline等)记载航线编号、客户编号等信息。实现代码加在列表框的Click事件中,如下:
Private Sub Combo1_Click(Index As Integer)
Dim mrcc As ADODB.Recordset
Dim mrcd As ADODB.Recordset
Dim MsgText As String
‘判断列表框编号
If Index = 2 Then
‘判断出发城市和到达城市是否选择
If Not (Trim(Combo1(0)) = "" Or Trim(Combo1(1)) = "") Then
txtSQL = "select * from airlineInfo where departCity = '" & Trim(Combo1(0)) & "' and arrivalCity = '" & Trim(Combo1(1)) & "'"
Set mrcc = ExecuteSQL(txtSQL, MsgText)
‘判断数据集对象是否为空
If Not mrcc.EOF Then
txtairline = mrcc.Fields(0)
ticketCsum = mrcc!planeNO
If Trim(Combo1(2)) = "经济舱" Then
Combo1(3).Clear
Combo1(3).AddItem mrcc.Fields(7)
Combo1(3).ListIndex = 0
ElseIf Trim(Combo1(2)) = "公务舱" Then
Combo1(3).Clear
Combo1(3).AddItem mrcc.Fields(8)
Combo1(3).ListIndex = 0
Else
Combo1(3).Clear
Combo1(3).AddItem mrcc.Fields(9)
Combo1(3).ListIndex = 0
End If
End If
‘关闭数据集对象
mrcc.Close
<< 上一页 [11] [12] [13] [14] [15] [16] 下一页