📄 formdriver.frm
字号:
Height = 375
Left = 9240
TabIndex = 15
Top = 2280
Width = 1215
End
Begin VB.CommandButton CmdDel
Caption = "删除"
Height = 375
Left = 9240
TabIndex = 16
Top = 3120
Width = 1215
End
Begin VB.CommandButton CmdEmpty
Caption = "清空"
Height = 375
Left = 9240
TabIndex = 13
Top = 600
Width = 1215
End
Begin VB.TextBox TxtQueWorkNum
Height = 375
Left = -72720
TabIndex = 22
Top = 2400
Width = 2175
End
Begin VB.TextBox TxtQueNum
Height = 375
Left = -72720
TabIndex = 19
Top = 1200
Width = 2175
End
Begin VB.TextBox TxtQueName
Height = 375
Left = -72720
TabIndex = 18
Top = 600
Width = 2175
End
Begin VB.TextBox TxtQueRemark
Height = 375
Left = -72720
TabIndex = 23
Top = 3000
Width = 2175
End
Begin VB.CommandButton CmdQue
Caption = "查询"
Height = 375
Left = -71760
TabIndex = 24
Top = 3480
Width = 1215
End
Begin MSComCtl2.DTPicker DTPBir
Height = 375
Left = 1680
TabIndex = 6
Top = 2280
Width = 2175
_ExtentX = 3836
_ExtentY = 661
_Version = 393216
Format = 20840449
CurrentDate = 36526
End
Begin MSComCtl2.DTPicker DTPLicDate
Height = 375
Left = 6240
TabIndex = 11
Top = 2160
Width = 2175
_ExtentX = 3836
_ExtentY = 661
_Version = 393216
Format = 20840449
CurrentDate = 39448
End
Begin VB.Label Label10
Caption = "备注:"
Height = 375
Index = 0
Left = 240
TabIndex = 35
Top = 3600
Width = 735
End
Begin VB.Label Label9
Caption = "驾照截止日期:"
Height = 375
Index = 0
Left = 4800
TabIndex = 34
Top = 2280
Width = 1455
End
Begin VB.Label Label8
Caption = "司机驾照号:"
Height = 375
Index = 0
Left = 4800
TabIndex = 33
Top = 1800
Width = 1455
End
Begin VB.Label Label7
Caption = "隶属车队名:"
Height = 255
Index = 0
Left = 4800
TabIndex = 32
Top = 1200
Width = 1335
End
Begin VB.Label Label6
Caption = "电话(手机):"
Height = 255
Index = 0
Left = 4800
TabIndex = 31
Top = 720
Width = 1455
End
Begin VB.Label Label5
Caption = "司机工号:"
Height = 255
Index = 0
Left = 240
TabIndex = 30
Top = 3000
Width = 1455
End
Begin VB.Label Label4
Caption = "出生日期:"
Height = 255
Index = 0
Left = 240
TabIndex = 29
Top = 2400
Width = 1215
End
Begin VB.Label Label3
Caption = "性别:"
Height = 255
Index = 0
Left = 240
TabIndex = 28
Top = 1800
Width = 1335
End
Begin VB.Label Label2
Caption = "身份证号:"
Height = 255
Index = 0
Left = 240
TabIndex = 27
Top = 1200
Width = 1215
End
Begin VB.Label Label1
Caption = "司机姓名:"
Height = 255
Index = 0
Left = 240
TabIndex = 26
Top = 720
Width = 1215
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 495
Left = 7920
Top = 8160
Visible = 0 'False
Width = 2175
_ExtentX = 3836
_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.Frame Frame2
Height = 3495
Left = 120
TabIndex = 0
Top = 5520
Width = 10815
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "FormDriver.frx":0182
Height = 3135
Left = 120
TabIndex = 17
Top = 240
Width = 10575
_ExtentX = 18653
_ExtentY = 5530
_Version = 393216
ColumnHeaders = -1 'True
HeadLines = 1
RowHeight = 15
AllowAddNew = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
End
Attribute VB_Name = "FormDriver"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'*********************************************************************
'初始化过程
'*********************************************************************
Private Sub Form_Load()
'初始化ADO控件,连接数据库,设置列首
Adodc1.ConnectionString = CnStr
Adodc1.RecordSource = "Select DriverID as 司机ID," & _
"DriverName as 姓名," & _
"DriverNum as 身份证号," & _
"DriverSex as 性别," & _
"DriverBir as 出生日期," & _
"DriverWorkNum as 工号," & _
"DriverTel as 电话," & _
"DriverTeam as 隶属车队名," & _
"DriverLicenceNum as 司机驾照号," & _
"DriverLicenceDate as 驾照截止日期," & _
"Remark as 备注 " & _
"From DriverInfo"
Debug.Print Adodc1.RecordSource
'将DataGrid控件与Adodc控件绑定
Set DataGrid1.DataSource = Adodc1 '不能缺少
End Sub
'DataGrid控件中的焦点变换
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
'检验是否为空行
If DataGrid1.Columns(0).Text = "" Then
Exit Sub
End If
'将DataGrid中数据读入各个控件显示数据内容
Me.TxtName.Text = DataGrid1.Columns(1).Text
Me.TxtNum.Text = DataGrid1.Columns(2).Text
If DataGrid1.Columns(3).Text = 0 Then
Me.OptSex(0).Value = True
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -