📄 jian_frm.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form jian_frm
BackColor = &H00400000&
Caption = "吉安市公交车查询系统"
ClientHeight = 4515
ClientLeft = 5310
ClientTop = 3405
ClientWidth = 5010
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4515
ScaleWidth = 5010
Begin MSAdodcLib.Adodc ado
Height = 330
Left = 2640
Top = 3960
Visible = 0 'False
Width = 1455
_ExtentX = 2566
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = ""
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.TextBox Text1
BackColor = &H00C0E0FF&
ForeColor = &H000000FF&
Height = 2055
Left = 2640
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 6
Top = 1560
Width = 2175
End
Begin VB.CommandButton Command1
Caption = "查询"
Height = 375
Left = 480
TabIndex = 4
Top = 2520
Width = 1335
End
Begin VB.ComboBox Combo1
BackColor = &H00C0E0FF&
ForeColor = &H000000FF&
Height = 300
ItemData = "jian_frm.frx":0000
Left = 240
List = "jian_frm.frx":0013
Sorted = -1 'True
TabIndex = 3
Top = 1680
Width = 1935
End
Begin VB.Frame Frame2
BackColor = &H00FFC0C0&
Height = 2895
Left = 2520
TabIndex = 1
Top = 960
Width = 2415
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "停靠站"
Height = 495
Left = 240
TabIndex = 7
Top = 360
Width = 1455
End
End
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Height = 2895
Left = 120
TabIndex = 0
Top = 960
Width = 2295
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "车号:"
Height = 375
Left = 480
TabIndex = 5
Top = 360
Width = 1455
End
End
Begin VB.Label Label1
BackColor = &H00404040&
BorderStyle = 1 'Fixed Single
Caption = "吉安市公交车查询系统"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 495
Left = 1200
TabIndex = 2
Top = 240
Width = 2895
End
End
Attribute VB_Name = "jian_frm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
'看是否选择车号
If Combo1.Text = "" Then
MsgBox "请你选择车号!", 16, "提示"
Exit Sub
End If
Ado.Recordset.Close
Ado.Recordset.Open "select * from jian where bus_num='" + Combo1.Text + " '"
'看你输入的车号是否已经存在
If Ado.Recordset.EOF Then
MsgBox "你所输入的车号还没登记"
Else
Text1.Text = Ado.Recordset.Fields("bus_add").value
End If
Command1.Enabled = True
End Sub
Private Sub Form_Load()
'采用ADO控件的方法连接数据库中的`JIAN表
Ado.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db1.mdb;Persist Security Info=False"
Ado.CommandType = adCmdText
Ado.RecordSource = "select * from jian"
Ado.Refresh
For a = 0 To Ado.Recordset.RecordCount - 1
Ado.Recordset.MoveNext
Next
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -