?? form1.frm
字號:
VERSION 5.00
Begin VB.Form Form1
BackColor = &H00FFC0C0&
Caption = "公交車查詢系統(tǒng)"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
ForeColor = &H00FFC0C0&
LinkTopic = "Form1"
ScaleHeight = 10830
ScaleWidth = 15240
WindowState = 2 'Maximized
Begin VB.CommandButton clear
Caption = "清空內(nèi)容"
Height = 495
Left = 6960
TabIndex = 17
Top = 6720
Width = 1455
End
Begin VB.Frame Frame2
BackColor = &H00C0FFC0&
BorderStyle = 0 'None
Caption = "顯示結(jié)果"
Height = 2535
Left = 720
TabIndex = 13
Top = 3720
Width = 8535
Begin VB.Label Label7
BackColor = &H00C0FFC0&
Caption = "顯示結(jié)果"
Height = 255
Left = 240
TabIndex = 18
Top = 120
Width = 1095
End
Begin VB.Label text2
BackColor = &H00FFFFFF&
ForeColor = &H000000FF&
Height = 1860
Left = 120
TabIndex = 14
Top = 600
Width = 8370
End
End
Begin VB.Frame Frame3
BackColor = &H00C0FFC0&
BorderStyle = 0 'None
Caption = "換乘查詢"
Height = 1575
Left = 720
TabIndex = 4
Top = 1680
Width = 8535
Begin VB.CommandButton Command1
Caption = "查詢"
Height = 375
Left = 3600
TabIndex = 9
Top = 840
Width = 1095
End
Begin VB.TextBox Text6
Height = 495
Left = 1680
TabIndex = 8
Top = 840
Width = 1695
End
Begin VB.TextBox Text5
Height = 495
Left = 1680
TabIndex = 7
Top = 240
Width = 1695
End
Begin VB.Label Label4
AutoSize = -1 'True
BackColor = &H00C0FFC0&
Caption = "請輸入終點站"
Height = 180
Left = 360
TabIndex = 6
Top = 960
Width = 1080
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H00C0FFC0&
Caption = "請輸入起始站"
Height = 180
Left = 360
TabIndex = 5
Top = 360
Width = 1080
End
End
Begin VB.Frame Frame1
BackColor = &H00C0FFC0&
BorderStyle = 0 'None
Caption = "查詢站點"
Height = 1335
Left = 720
TabIndex = 0
Top = 240
Width = 8535
Begin VB.CommandButton Command3
Caption = "線路查詢"
Height = 375
Left = 5640
TabIndex = 12
Top = 840
Width = 1095
End
Begin VB.TextBox Text3
Height = 495
Left = 2040
TabIndex = 11
Top = 720
Width = 1575
End
Begin VB.CommandButton Command2
Caption = "站點查詢"
Height = 375
Left = 5640
TabIndex = 3
Top = 240
Width = 1095
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
DataField = "busstation"
DataSource = "Adodc1"
Height = 495
Left = 2040
TabIndex = 2
Top = 120
Width = 1575
End
Begin VB.Label Label5
BackColor = &H00C0FFC0&
Caption = "格式如:(濟南大學)"
Height = 375
Left = 3720
TabIndex = 16
Top = 240
Width = 1575
End
Begin VB.Label Label3
BackColor = &H00C0FFC0&
Caption = "格式如:2"
Height = 495
Left = 3720
TabIndex = 15
Top = 720
Width = 1695
End
Begin VB.Label Label6
AutoSize = -1 'True
BackColor = &H00C0FFC0&
Caption = "請輸入要查詢的線路"
Height = 180
Left = 240
TabIndex = 10
Top = 720
Width = 1620
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00C0FFC0&
Caption = "請輸入要查詢的站點"
Height = 180
Left = 240
TabIndex = 1
Top = 240
Width = 1620
End
End
Begin VB.Menu sysdata
Caption = "管理數(shù)據(jù)庫(&A)"
End
Begin VB.Menu syshelp
Caption = "幫助(&H)"
Begin VB.Menu sysfunc
Caption = "系統(tǒng)功能"
End
Begin VB.Menu sysshow
Caption = "系統(tǒng)說明"
End
Begin VB.Menu call
Caption = "聯(lián)系我"
End
End
Begin VB.Menu exit
Caption = "退出系統(tǒng)"
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub clear_Click()
Text1.Text = ""
text2.Caption = ""
Text3.Text = ""
Text5.Text = ""
Text6.Text = ""
Text1.SetFocus
End Sub
Private Sub call_Click()
call1.Show
End Sub
Private Sub Command1_Click()
text2.Caption = ""
Dim cn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
Dim param As ADODB.Parameter
If (Text5.Text = "" And Text6.Text = "") Then
MsgBox ("請輸入要查詢的內(nèi)容!在點擊查詢")
Else
Set cn = New ADODB.Connection
cn.ConnectionString = "provider=msdasql.1;USER ID=sa;password=;initial catalog=bus;data source=data;"
cn.Open
cmd.ActiveConnection = cn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "p_qry3 "
rs.CursorLocation = adUseClient
rs.CursorType = adOpenDynamic
rs.LockType = adLockReadOnly
cmd.Prepared = True
Set param = cmd.CreateParameter("@start", adVarChar, adParamInput, 10, Trim(Text5.Text))
cmd.Parameters.Append param
Set param = cmd.CreateParameter("@stop", adVarChar, adParamInput, 10, Trim(Text6.Text))
cmd.Parameters.Append param
rs.Open cmd
cmd.Execute
If (rs.EOF) Then
MsgBox ("很抱歉沒找到!")
Else
text2.Caption = "轉(zhuǎn)車次數(shù): " & rs!轉(zhuǎn)車次數(shù) & Space(3) & "乘車線路是:" & rs!乘車線路
End If
End If
Exit Sub
End Sub
Private Sub Command2_Click()
text2.Caption = " "
Dim str As String
Dim cn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
If (Text1.Text = "") Then
MsgBox ("請輸入要查詢的內(nèi)容!在點擊查詢按紐。")
Else
Set cn = New ADODB.Connection
cn.ConnectionString = "provider=msdasql.1;USER ID=sa;password=;initial catalog=bus;data source=data;"
cn.Open
cmd.ActiveConnection = cn
cmd.CommandType = adCmdText
cmd.CommandText = "SELECT distinct 線路 from table1 where" & " 站點='" & Text1.Text & "'"
rs.CursorLocation = adUseClient
rs.CursorType = adOpenStatic
rs.LockType = adLockReadOnly
rs.Open cmd
cmd.Execute
If (rs.EOF) Then
MsgBox ("很抱歉沒找到!")
Else
rs.MoveFirst
Do While Not rs.EOF
str = str & Trim(rs!線路) + Space(1)
rs.MoveNext
Loop
text2.Caption = str
End If
End If
End Sub
Private Sub exit_Click()
End
End Sub
Private Sub Command3_Click()
Dim str As String
text2.Caption = ""
Dim cn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
If (Text3.Text = "") Then
MsgBox ("請輸入要查詢的內(nèi)容!在點擊查詢")
Else
Set cn = New ADODB.Connection
cn.ConnectionString = "provider=msdasql.1;USER ID=sa;password=sa;initial catalog=bus;data source=data;"
cn.Open
cmd.ActiveConnection = cn
cmd.CommandType = adCmdText
cmd.CommandText = "SELECT distinct 站點,順序 from table1 where" & " 線路='" & Text3.Text & "'" & "ORDER BY 順序"
rs.CursorLocation = adUseClient
rs.CursorType = adOpenStatic
rs.LockType = adLockReadOnly
rs.Open cmd
cmd.Execute
str = Text3.Text & " 路所經(jīng)過的站點:"
If (rs.EOF) Then
MsgBox ("很抱歉沒找到!")
Else
rs.MoveFirst
Do While Not rs.EOF
str = str + Trim(rs!站點) + Space(1)
rs.MoveNext
Loop
text2.Caption = str
End If
End If
End Sub
Private Sub Form_Load()
If frmLogin.Combo1.Text = "普通用戶" Then sysdata.Visible = False
End Sub
Private Sub sysdata_Click()
Form2.Show
End Sub
Private Sub sysfunc_Click()
sysfunc1.Show
End Sub
Private Sub sysshow_Click()
sysshow1.Show
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -