📄 driver~1.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form driver_frm
BackColor = &H00400000&
Caption = "司机基本信息之二"
ClientHeight = 5835
ClientLeft = 4830
ClientTop = 2730
ClientWidth = 6660
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 5835
ScaleWidth = 6660
Begin VB.TextBox Text3
BackColor = &H00C0E0FF&
ForeColor = &H000000FF&
Height = 375
Left = 1200
TabIndex = 13
Top = 2520
Width = 1215
End
Begin VB.Frame Frame2
BackColor = &H00FFC0C0&
Height = 3495
Left = 3360
TabIndex = 6
Top = 240
Width = 3015
Begin VB.TextBox Text5
BackColor = &H00C0E0FF&
ForeColor = &H000000FF&
Height = 615
Index = 1
Left = 1200
TabIndex = 18
Top = 2640
Width = 1455
End
Begin VB.TextBox Text4
BackColor = &H00C0E0FF&
ForeColor = &H000000FF&
Height = 375
Left = 1200
TabIndex = 16
Top = 1920
Width = 1455
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 1560
Left = 1200
Picture = "DRIVER~1.frx":0000
Top = 240
Width = 1560
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "照片"
ForeColor = &H00404040&
Height = 495
Left = 360
TabIndex = 21
Top = 720
Width = 855
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "家庭住址"
ForeColor = &H00404040&
Height = 375
Left = 240
TabIndex = 17
Top = 2640
Width = 855
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "联系电话"
ForeColor = &H00404040&
Height = 375
Left = 240
TabIndex = 15
Top = 1920
Width = 855
End
End
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Height = 3735
Left = 240
TabIndex = 5
Top = 240
Width = 2895
Begin VB.TextBox Text6
BackColor = &H00C0E0FF&
ForeColor = &H000000FF&
Height = 615
Left = 960
TabIndex = 20
Top = 2880
Width = 1455
End
Begin VB.TextBox Text2
BackColor = &H00C0E0FF&
ForeColor = &H000000FF&
Height = 375
Left = 960
TabIndex = 11
Top = 240
Width = 1215
End
Begin VB.TextBox Text1
BackColor = &H00C0E0FF&
ForeColor = &H000000FF&
Height = 375
Left = 960
TabIndex = 10
Top = 1680
Width = 1215
End
Begin VB.TextBox txt_car_num
BackColor = &H00C0E0FF&
ForeColor = &H000000FF&
Height = 375
Left = 960
TabIndex = 8
Top = 960
Width = 1215
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "备注"
Height = 255
Left = 240
TabIndex = 19
Top = 3000
Width = 855
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "出生年月"
Height = 375
Left = 240
TabIndex = 14
Top = 2280
Width = 735
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "性别"
ForeColor = &H00404040&
Height = 375
Left = 240
TabIndex = 12
Top = 1680
Width = 615
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "姓名"
ForeColor = &H00404040&
Height = 375
Left = 240
TabIndex = 9
Top = 240
Width = 615
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "车号"
ForeColor = &H00404040&
Height = 375
Left = 240
TabIndex = 7
Top = 960
Width = 495
End
End
Begin MSAdodcLib.Adodc ado
Height = 495
Left = 1080
Top = 1560
Visible = 0 'False
Width = 1455
_ExtentX = 2566
_ExtentY = 873
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.CommandButton Command4
BackColor = &H00FFC0C0&
Caption = "最后一条记录"
Height = 495
Left = 5160
Style = 1 'Graphical
TabIndex = 4
Top = 4680
Width = 1215
End
Begin VB.CommandButton Command3
Appearance = 0 'Flat
BackColor = &H00FFC0C0&
Caption = "下一条记录"
Height = 495
Left = 3480
Style = 1 'Graphical
TabIndex = 3
Top = 4680
Width = 1215
End
Begin VB.CommandButton Command2
BackColor = &H00FFC0C0&
Caption = "上一条记录"
Height = 495
Left = 1800
Style = 1 'Graphical
TabIndex = 2
Top = 4680
Width = 1215
End
Begin VB.CommandButton Command1
BackColor = &H00FFC0C0&
Caption = "第一条记录"
Height = 495
Left = 240
Style = 1 'Graphical
TabIndex = 1
Top = 4680
Width = 1215
End
Begin VB.TextBox Text5
DataField = "driver_add"
DataSource = "Data1"
Height = 1575
Index = 0
Left = 7920
TabIndex = 0
Top = 2280
Width = 1935
End
End
Attribute VB_Name = "driver_frm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
'用来查询第一条记录
Ado.Recordset.Close
Ado.Recordset.Open "select * from driver_message "
If Ado.Recordset.EOF Then
MsgBox "你所输入的车号还没登记"
Else
Call viewdata
End If
Command1.Enabled = True
End Sub
'编写一个该窗体的公用函数
Public Sub viewdata()
txt_car_num.Text = Ado.Recordset.Fields("car_num").value
Text2.Text = Ado.Recordset.Fields("driver_name").value
Text1.Text = Ado.Recordset.Fields("driver_sex").value
Text3.Text = Ado.Recordset.Fields("driver_day").value
Text4.Text = Ado.Recordset.Fields("driver_phone").value
Text5(1).Text = Ado.Recordset.Fields("driver_add").value
Text6.Text = Ado.Recordset.Fields("driver_shuo").value
End Sub
Private Sub Command2_Click()
'用来查询上一条记录
Ado.Recordset.MovePrevious
If Ado.Recordset.BOF Then
Ado.Recordset.MoveLast
End If
Call viewdata
End Sub
Private Sub Command3_Click()
'用来查询下一条记录
If Ado.Recordset.EOF Then
Ado.Recordset.MoveFirst
Else
Ado.Recordset.MoveNext
If Ado.Recordset.EOF Then
Ado.Recordset.MoveFirst
End If
End If
Call viewdata
End Sub
Private Sub Command4_Click()
'用来查询最后一条记录
Ado.Recordset.MoveLast
Call viewdata
End Sub
Private Sub Form_Load()
'采用ADO控件来连接数据库里面的表driver_message
Ado.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db1.mdb;Persist Security Info=False"
Ado.CommandType = adCmdText
Ado.RecordSource = "select * from driver_message"
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 + -