?? frmcarydcha.frm
字號:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmcarYDcha
BorderStyle = 3 'Fixed Dialog
Caption = "車輛異動查詢"
ClientHeight = 3555
ClientLeft = 45
ClientTop = 330
ClientWidth = 6255
LinkTopic = "Form7"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3555
ScaleWidth = 6255
ShowInTaskbar = 0 'False
Begin VB.Frame Frame2
Caption = "Frame2"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 1770
Left = 90
TabIndex = 10
Top = 1650
Width = 6015
Begin MSAdodcLib.Adodc Adodc1
Height = 360
Left = 5115
Top = 555
Visible = 0 'False
Width = 1575
_ExtentX = 2778
_ExtentY = 635
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 車輛異動表"
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 MSDataGridLib.DataGrid DataGrid1
Bindings = "frmcarydcha.frx":0000
Height = 1410
Left = 135
TabIndex = 11
Top = 210
Width = 5760
_ExtentX = 10160
_ExtentY = 2487
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 15
FormatLocked = -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 = 5
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
BeginProperty Column02
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 Column03
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 Column04
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
ColumnWidth = 870.236
EndProperty
BeginProperty Column01
ColumnWidth = 810.142
EndProperty
BeginProperty Column02
ColumnWidth = 870.236
EndProperty
BeginProperty Column03
ColumnWidth = 975.118
EndProperty
BeginProperty Column04
ColumnWidth = 1725.165
EndProperty
EndProperty
End
End
Begin VB.Frame Frame1
Caption = " 查詢條件"
ForeColor = &H00FF0000&
Height = 1485
Left = 75
TabIndex = 0
Top = 60
Width = 6015
Begin VB.CommandButton cmdCha
Caption = "查 詢(&F)"
Height = 375
Left = 5010
TabIndex = 13
Top = 240
Width = 915
End
Begin VB.CommandButton cmdExit
Caption = "退 出(&E)"
Height = 375
Left = 5010
TabIndex = 12
Top = 930
Width = 915
End
Begin MSComCtl2.DTPicker dtEnd
Height = 300
Left = 3435
TabIndex = 9
Top = 990
Width = 1485
_ExtentX = 2619
_ExtentY = 529
_Version = 393216
Enabled = 0 'False
Format = 27066369
CurrentDate = 38053
End
Begin MSComCtl2.DTPicker dtStart
Height = 300
Left = 1620
TabIndex = 8
Top = 990
Width = 1485
_ExtentX = 2619
_ExtentY = 529
_Version = 393216
Enabled = 0 'False
Format = 27066369
CurrentDate = 38053
End
Begin VB.ComboBox cmdd
Enabled = 0 'False
Height = 300
Left = 1620
TabIndex = 7
Top = 615
Width = 2415
End
Begin VB.ComboBox cmcp
Enabled = 0 'False
Height = 300
Left = 1620
TabIndex = 6
Top = 255
Width = 2415
End
Begin VB.CheckBox ckdd
Caption = "異動地點:"
Height = 255
Left = 135
TabIndex = 5
Top = 630
Width = 1215
End
Begin VB.CheckBox cktime
Caption = "異動時間:"
Height = 255
Left = 135
TabIndex = 4
Top = 1035
Width = 1215
End
Begin VB.CheckBox ckcp
Caption = "車牌號碼:"
Height = 255
Left = 120
TabIndex = 3
Top = 240
Width = 1215
End
Begin VB.Label Label5
Caption = "到"
ForeColor = &H00FF0000&
Height = 255
Left = 3180
TabIndex = 2
Top = 1020
Width = 255
End
Begin VB.Label Label6
Caption = "從"
ForeColor = &H00FF0000&
Height = 255
Left = 1335
TabIndex = 1
Top = 1050
Width = 255
End
End
End
Attribute VB_Name = "frmcarydcha"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub ckcp_Click()
If ckcp.Value Then
cmCP.Enabled = True
Else
cmCP.Enabled = False
End If
End Sub
Private Sub ckdd_Click()
If ckdd.Value Then
cmdd.Enabled = True
Else
cmdd.Enabled = False
End If
End Sub
Private Sub cktime_Click()
If cktime.Value Then
dtStart.Enabled = True
dtEnd.Enabled = True
Else
dtStart.Enabled = False
dtEnd.Enabled = False
End If
End Sub
Private Sub cmdCha_Click()
'點擊查詢按紐后首先清空車輛檔案列表
Call QingKong
Dim sql As String
Dim scp As String
If ckcp.Value Then
scp = "車牌號碼 like '%" & cmCP.Text & "%'"
Else
scp = "車牌號碼 like '%'"
End If
Dim stime As String
If cktime.Value Then
stime = "異動時間 between #" & dtStart.Month & "/" & dtStart.Day & "/" & dtStart.Year & "# and #" & dtEnd.Month & "/" & dtEnd.Day & "/" & dtEnd.Year & "#"
Else
stime = "異動時間 like '%'"
End If
Dim sdd As String
If ckdd.Value Then
cmdd.Enabled = True
sdd = "異動地點 like'%" & cmdd.Text & "%'"
Else
sdd = "異動地點 like '%'"
End If
sql = "select * from 車輛異動表 where " & scp & "and " & stime & "and " & sdd
If sql = "select * from 車輛異動表 where 車牌號碼 like '%'and 異動時間 like '%'and 異動地點 like '%'" Then
Call QingKong
MsgBox "請選擇查詢條件", , "系統提示"
Exit Sub
End If
Set adors = adoCon.Execute(sql)
If adors.EOF Then
Call QingKong
MsgBox "沒有符合您查詢車輛的條件!", , "系統提示"
Else
Adodc1.RecordSource = sql
Adodc1.Refresh
End If
adors.Close
ckcp.Value = 0
cktime.Value = 0
ckdd.Value = 0
End Sub
Private Sub cmdExit_Click()
MDIForm1.StatusBar1.Panels(1).Text = ""
Unload Me
End Sub
Private Sub Form_Load()
frmcarydcha.Width = 6345
frmcarydcha.Height = 3930
Call Rebind
Set adors = adoCon.Execute("select distinct 車牌號碼 from 車輛異動表")
On Error Resume Next
Do
cmCP.AddItem adors.Fields(0)
adors.MoveNext
Loop Until adors.EOF
adors.Close
Set adors = adoCon.Execute("select distinct 異動地點 from 車輛異動表")
On Error Resume Next
Do
cmdd.AddItem adors.Fields(0)
adors.MoveNext
Loop Until adors.EOF
adors.Close
End Sub
Private Sub Rebind()
Frame2.Caption = "車輛異動列表"
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\clgl.mdb " & ";Persist Security Info=False"
Adodc1.RecordSource = "select * from 車輛異動表"
Adodc1.Refresh
End Sub
Private Sub QingKong()
Frame2.Caption = "您所要查詢的異動車輛如下:"
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\clgl.mdb " & ";Persist Security Info=False"
Adodc1.RecordSource = "select * from 車輛異動表 where 1=0"
Adodc1.Refresh
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
cmdExit_Click
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -