📄 frmtarget.frm
字号:
VERSION 5.00
Begin VB.Form frmTarget
BorderStyle = 3 'Fixed Dialog
Caption = "车辆数据"
ClientHeight = 5895
ClientLeft = 2460
ClientTop = 2730
ClientWidth = 7350
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5895
ScaleWidth = 7350
ShowInTaskbar = 0 'False
Begin VB.TextBox txtFields
DataField = "CommID"
DataSource = "datPrimaryRS"
Height = 285
Index = 5
Left = 1680
MaxLength = 20
TabIndex = 16
Top = 620
Width = 3375
End
Begin VB.TextBox txtFields
DataField = "Name"
DataSource = "datPrimaryRS"
Height = 285
Index = 0
Left = 1680
MaxLength = 20
TabIndex = 9
Top = 240
Width = 3375
End
Begin VB.TextBox txtFields
DataField = "Owner"
DataSource = "datPrimaryRS"
Height = 285
Index = 3
Left = 1680
MaxLength = 20
TabIndex = 8
Top = 1760
Width = 3375
End
Begin VB.TextBox txtFields
DataField = "No"
DataSource = "datPrimaryRS"
Height = 285
Index = 1
Left = 1680
MaxLength = 20
TabIndex = 7
Top = 1000
Width = 3375
End
Begin VB.CheckBox chkFields
DataField = "Track"
DataSource = "datPrimaryRS"
Height = 285
Index = 8
Left = 2280
TabIndex = 6
Top = 2520
Width = 255
End
Begin VB.TextBox txtFields
DataField = "Type"
DataSource = "datPrimaryRS"
Height = 285
Index = 2
Left = 1680
MaxLength = 20
TabIndex = 5
Top = 1380
Width = 3375
End
Begin VB.TextBox txtFields
DataField = "Tel"
DataSource = "datPrimaryRS"
Height = 285
Index = 4
Left = 1680
MaxLength = 20
TabIndex = 4
Top = 2160
Width = 3375
End
Begin VB.PictureBox picButtons
Align = 2 'Align Bottom
Appearance = 0 'Flat
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 300
Left = 0
ScaleHeight = 300
ScaleWidth = 7350
TabIndex = 0
Top = 5250
Width = 7350
Begin VB.CommandButton cmdClose
Caption = "关闭"
Height = 300
Left = 4505
TabIndex = 3
Top = 0
Width = 975
End
Begin VB.CommandButton cmdDelete
Caption = "删除"
Height = 300
Left = 1217
TabIndex = 2
Top = 0
Width = 975
End
Begin VB.CommandButton cmdAdd
Caption = "增加"
Height = 300
Left = 121
TabIndex = 1
Top = 0
Width = 975
End
End
Begin VB.Data datPrimaryRS
Align = 2 'Align Bottom
Caption = " "
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 0
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "Target"
Top = 5550
Width = 7350
End
Begin VB.Label lblLabels
Caption = "通讯码:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 5
Left = 480
TabIndex = 17
Top = 620
Width = 1095
End
Begin VB.Label lblLabels
Caption = "车辆名称:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 0
Left = 480
TabIndex = 15
Top = 240
Width = 1095
End
Begin VB.Label lblLabels
Caption = "车主姓名:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 3
Left = 480
TabIndex = 14
Top = 1760
Width = 975
End
Begin VB.Label lblLabels
Caption = "车牌号码:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 1
Left = 480
TabIndex = 13
Top = 1000
Width = 1095
End
Begin VB.Label lblLabels
Caption = "是否显示轨迹:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 8
Left = 480
TabIndex = 12
Top = 2520
Width = 1575
End
Begin VB.Label lblLabels
Caption = "车型:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 2
Left = 480
TabIndex = 11
Top = 1380
Width = 975
End
Begin VB.Label lblLabels
Caption = "串口号"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 4
Left = 480
TabIndex = 10
Top = 2140
Width = 1095
End
End
Attribute VB_Name = "frmTarget"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private m_bRebuild As Boolean
'Public Function FindByName(ByVal KjID As String) As Boolean
'On Error GoTo errhandle
' datPrimaryRS.Recordset.Index = "CarID"
' datPrimaryRS.Recordset.FindFirst "Name=" & KjID
' If datPrimaryRS.Recordset.NoMatch Then Exit Function
' FindByName = True
'errhandle:
'End Function
Public Function FindByID(ByVal lTargetID As Long) As Boolean
On Error GoTo errhandle
'datPrimaryRS.Recordset.Index =
datPrimaryRS.Recordset.FindFirst "ID=" & lTargetID
If datPrimaryRS.Recordset.NoMatch Then Exit Function
FindByID = True
errhandle:
End Function
Public Function FindByName(ByVal lTargetName As String) As Boolean
On Error GoTo errhandle
'datPrimaryRS.Recordset.Index =
datPrimaryRS.Recordset.FindFirst "Name=" & lTargetName
If datPrimaryRS.Recordset.NoMatch Then Exit Function
FindByName = True
errhandle:
End Function
Private Sub cmdAdd_Click()
''On Error GoTo errhandle
datPrimaryRS.Recordset.AddNew
m_bRebuild = True
''errhandle:
End Sub
Private Sub cmdDelete_Click()
On Error GoTo errhandle
With datPrimaryRS.Recordset
.Delete
.MoveNext
If .EOF Then .MoveLast
m_bRebuild = True
End With
errhandle:
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub datPrimaryRS_Error(DataErr As Integer, response As Integer)
MsgBox "数据错误:" + Chr(13) + Chr(10) + "名称和通讯码未输入,或不唯一"
response = 0
End Sub
Private Sub datPrimaryRS_Reposition()
On Error Resume Next
datPrimaryRS.Caption = "Record: " & (datPrimaryRS.Recordset.AbsolutePosition + 1)
End Sub
Private Sub Form_Load()
m_bRebuild = False
datPrimaryRS.DatabaseName = strPath + PATH_DBDATA
datPrimaryRS.RecordSource = "Target"
End Sub
Private Sub Form_Unload(Cancel As Integer)
If m_bRebuild Then
MDIMainForm.oTargetManager.Rebuild
Else
MDIMainForm.oTargetManager.Refresh
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -