📄 seldriver_frm.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form seldriver_frm
BackColor = &H00400000&
Caption = "查询司机信息之一"
ClientHeight = 5760
ClientLeft = 5880
ClientTop = 3120
ClientWidth = 5655
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 5760
ScaleWidth = 5655
Begin MSAdodcLib.Adodc Ado
Height = 330
Left = 2280
Top = 5400
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_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 = "Adodc1"
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.Frame Frame3
BackColor = &H00FFC0C0&
ClipControls = 0 'False
Height = 2175
Left = 3000
TabIndex = 6
Top = 3000
Width = 2415
Begin VB.PictureBox Picture1
BackColor = &H00FFC0C0&
BorderStyle = 0 'None
Height = 1215
Left = 480
Picture = "seldriver_frm.frx":0000
ScaleHeight = 1215
ScaleWidth = 1455
TabIndex = 8
Top = 120
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 480
TabIndex = 7
Top = 1440
Width = 1455
End
End
Begin VB.Frame Frame2
BackColor = &H00FFC0C0&
Height = 2535
Left = 360
TabIndex = 1
Top = 240
Width = 5055
Begin VB.TextBox Text7
BackColor = &H00C0E0FF&
Height = 1095
Left = 3240
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 21
Top = 1320
Width = 1575
End
Begin VB.TextBox Text6
BackColor = &H00C0E0FF&
Height = 375
Left = 3240
TabIndex = 19
Top = 480
Width = 1455
End
Begin VB.TextBox Text5
BackColor = &H00C0E0FF&
Height = 390
Left = 240
TabIndex = 17
Top = 1920
Width = 855
End
Begin VB.TextBox Text4
BackColor = &H00C0E0FF&
Height = 1095
Left = 1320
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 15
Top = 1320
Width = 1575
End
Begin VB.TextBox Text3
BackColor = &H00C0E0FF&
Height = 375
Left = 1440
TabIndex = 13
Top = 480
Width = 1455
End
Begin VB.TextBox Text2
BackColor = &H00C0E0FF&
Height = 375
Left = 240
TabIndex = 11
Top = 1200
Width = 855
End
Begin VB.TextBox Text1
BackColor = &H00C0E0FF&
ForeColor = &H000000FF&
Height = 375
Left = 240
TabIndex = 5
Top = 480
Width = 855
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "备注"
Height = 375
Left = 3120
TabIndex = 20
Top = 960
Width = 855
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "出生年龄"
Height = 255
Left = 3120
TabIndex = 18
Top = 240
Width = 855
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "电话号码"
Height = 255
Left = 120
TabIndex = 16
Top = 1680
Width = 855
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "地址"
Height = 255
Left = 1320
TabIndex = 14
Top = 960
Width = 495
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "姓名"
Height = 375
Left = 1320
TabIndex = 12
Top = 240
Width = 615
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "性别"
Height = 255
Left = 120
TabIndex = 10
Top = 960
Width = 495
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "车号"
Height = 375
Left = 120
TabIndex = 9
Top = 240
Width = 615
End
End
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Height = 2175
Left = 360
TabIndex = 0
Top = 3000
Width = 2535
Begin VB.CommandButton Command1
Caption = "查询"
Height = 375
Left = 480
TabIndex = 4
Top = 1440
Width = 1455
End
Begin VB.ComboBox Combo1
BackColor = &H00C0E0FF&
ForeColor = &H000000FF&
Height = 300
Left = 360
TabIndex = 3
Top = 720
Width = 1815
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "司机姓名"
Height = 495
Left = 360
TabIndex = 2
Top = 240
Width = 975
End
End
End
Attribute VB_Name = "seldriver_frm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
'提示选择公交车司机姓名
If Combo1.Text = "" Then
MsgBox "请你选择公交车司机姓名!", vbOKOnly + vbExclamation, "提示"
Exit Sub
End If
Ado.Recordset.Close
Ado.Recordset.Open "select * from driver_message where driver_name='" + Combo1.Text + " '"
If Ado.Recordset.EOF Then
MsgBox "你所输入的公交车司机姓名还没登记", vbOKOnly + vbExclamation, "提示"
Else
'数据集记录用文本框来显示
Text1.Text = Ado.Recordset.Fields("car_num").value
Text2.Text = Ado.Recordset.Fields("driver_sex").value
Text3.Text = Ado.Recordset.Fields("driver_name").value
Text4.Text = Ado.Recordset.Fields("driver_add").value
Text5.Text = Ado.Recordset.Fields("driver_phone").value
Text6.Text = Ado.Recordset.Fields("driver_day").value
Text7.Text = Ado.Recordset.Fields("driver_shuo").value
End If
End Sub
Private Sub Command2_Click()
Me.Hide
End Sub
Private Sub Form_Load()
Dim a As Integer
Ado.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\db1.mdb"
Ado.CommandType = adCmdText
Ado.RecordSource = "select * from driver_message"
Ado.Refresh
For a = 0 To Ado.Recordset.RecordCount - 1
'使数据集记录的第一列添加到COMBO1中
Combo1.AddItem Ado.Recordset.Fields(1)
'数据集记录下移
Ado.Recordset.MoveNext
Next
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -