.ColWidth(0) = 200
.ColWidth(NC + 1) = 1000
.FixedRows = 1
For i = 1 To NC
.ColAlignment(i) = 0
Next i
.FillStyle = flexFillSingle
.Col = 0
.Row = 0
.RowSel = 1
.ColSel = .Cols - 1
.CellAlignment = 4
.Row = 1
End With
Next
End Sub
Public Sub showdata(num As Integer)
'用于显示按车站名进行的查询
showtitle (num)
Dim j As Integer
Dim i As Integer
Dim mrc0 As ADODB.Recordset
Set mrc0 = New ADODB.Recordset
Set mrc0 = ExecuteSQL(txtsql)
If mrc0.EOF = False Then
mrc0.MoveFirst
With MSF1(num)
.Rows = 2
.Row = 1
Do While Not mrc0.EOF
.Rows = .Rows + 1
For i = 1 To mrc0.Fields.Count
If mrc0.Fields(i - 1) <> "Null" Then
.TextMatrix(.Row, i - 1) = mrc0.Fields(i - 1)
End If
Next i
.Row = .Row + 1
mrc0.MoveNext
Loop
End With
End If
Set mrc0 = Nothing
End Sub
Public Sub showSEdata(s As String, e As String, numb As Integer)
'用于显示按起始站和终点站进行的查询
'其思路是扫描整个数据库,如果在一条记录中有起点站和终点站则把该记录加到列表中
'该过程用到了递归主要是由于起始站和终点站可以互换
digein = digein + 1 ' 用于记录递归次数
If digein = 3 Then '第三次递归的时候,退出
a = MsgBox("没有直达的车次!您是否需要转车?", vbInformation + vbOKCancel, "询问")
If a = vbOK Then
Label5.Visible = True
Cbm.Visible = True
MSF1(0).Visible = False
End If
Exit Sub
End If
showtitle (numb)
Dim j As Integer
Dim i As Integer
Dim m As Integer
Dim k As Integer
Dim ball As Boolean
Dim mrc As ADODB.Recordset
Set mrc = New ADODB.Recordset
Set mrc = Adodc1.Recordset
mrc.MoveFirst
With MSF1(numb)
.Rows = 2
.Row = 1
Do While Not mrc.EOF
ball = False
For m = 1 To NC
If Text2(m).Text = Trim(s) Then
ball = True
Exit For
End If
Next
If ball = True Then
For k = m To NC
If Text2(k).Text = Trim(e) Then
Exit For
End If
Next
End If
If ball = True And k <> NC + 1 Then
.Rows = .Rows + 1
For i = 1 To mrc.Fields.Count
If mrc.Fields(i - 1) <> "Null" Then
.TextMatrix(.Row, i - 1) = mrc.Fields(i - 1)
End If
Ne
首页 上一页 2 3 4 5 6 7 下一页 尾页 5/7/7
公交车查询系统+vb(五)由毕业论文网(www.huoyuandh.com)会员上传。