?? frmdrivercha.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 frmDrivercha
Caption = "駕駛員檔案查詢"
ClientHeight = 4035
ClientLeft = 60
ClientTop = 345
ClientWidth = 7695
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 4035
ScaleWidth = 7695
Begin VB.Frame Frame2
Caption = "Frame2"
Height = 2265
Left = 45
TabIndex = 16
Top = 1680
Width = 7560
Begin MSAdodcLib.Adodc Adodc1
Height = 735
Left = 3585
Top = 960
Visible = 0 'False
Width = 2295
_ExtentX = 4048
_ExtentY = 1296
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 = ""
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 MSDataGridLib.DataGrid DataGrid1
Bindings = "frmDrivercha.frx":0000
Height = 1935
Left = 105
TabIndex = 17
Top = 210
Width = 7320
_ExtentX = 12912
_ExtentY = 3413
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 15
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
Begin VB.Frame Frame1
Caption = "查詢條件"
ForeColor = &H00FF0000&
Height = 1470
Left = 45
TabIndex = 0
Top = 105
Width = 7545
Begin VB.CommandButton cmdExit
Caption = "退 出(&E)"
Height = 360
Left = 6375
TabIndex = 15
Top = 1035
Width = 990
End
Begin VB.CommandButton cmdOk
Caption = "查 詢(&F)"
Height = 360
Left = 6375
TabIndex = 14
Top = 255
Width = 990
End
Begin VB.TextBox txtJL
Enabled = 0 'False
Height = 300
Left = 4785
TabIndex = 13
Top = 255
Width = 1335
End
Begin MSComCtl2.DTPicker dtYX
Height = 300
Left = 4785
TabIndex = 12
Top = 630
Width = 1335
_ExtentX = 2355
_ExtentY = 529
_Version = 393216
Enabled = 0 'False
Format = 66256897
CurrentDate = 38056
End
Begin MSComCtl2.DTPicker dtEnd
Height = 300
Left = 3465
TabIndex = 11
Top = 1005
Width = 1335
_ExtentX = 2355
_ExtentY = 529
_Version = 393216
Enabled = 0 'False
Format = 66256897
CurrentDate = 38056
End
Begin MSComCtl2.DTPicker dtStart
Height = 300
Left = 1740
TabIndex = 10
Top = 1005
Width = 1335
_ExtentX = 2355
_ExtentY = 529
_Version = 393216
Enabled = 0 'False
Format = 66256897
CurrentDate = 38056
End
Begin VB.TextBox txtName
Enabled = 0 'False
Height = 300
Left = 1740
TabIndex = 7
Top = 255
Width = 1335
End
Begin VB.ComboBox cmSex
Enabled = 0 'False
Height = 300
ItemData = "frmDrivercha.frx":0015
Left = 1740
List = "frmDrivercha.frx":001F
TabIndex = 6
Top = 630
Width = 1335
End
Begin VB.CheckBox ckName
Caption = "姓 名:"
Height = 255
Left = 195
TabIndex = 5
Top = 255
Width = 1215
End
Begin VB.CheckBox ckYX
Caption = "證件有效期:"
Height = 255
Left = 3465
TabIndex = 4
Top = 630
Width = 1575
End
Begin VB.CheckBox ckBorn
Caption = "出生年月:"
Height = 255
Left = 165
TabIndex = 3
Top = 1005
Width = 1215
End
Begin VB.CheckBox ckJL
Caption = "駕齡:"
Height = 180
Left = 3465
TabIndex = 2
Top = 255
Width = 855
End
Begin VB.CheckBox ckSex
Caption = "性別:"
Height = 180
Left = 195
TabIndex = 1
Top = 667
Width = 855
End
Begin VB.Label Label3
Caption = "到"
ForeColor = &H00FF0000&
Height = 255
Left = 3150
TabIndex = 9
Top = 1095
Width = 255
End
Begin VB.Label Label2
Caption = "從"
ForeColor = &H00FF0000&
Height = 255
Left = 1485
TabIndex = 8
Top = 1095
Width = 255
End
End
End
Attribute VB_Name = "frmDrivercha"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub ckBorn_Click()
If ckBorn.Value Then
dtStart.Enabled = True
dtEnd.Enabled = True
Else
dtStart.Enabled = False
dtEnd.Enabled = False
End If
End Sub
Private Sub ckJL_Click()
If ckJL.Value Then
txtJL.Enabled = True
Else
txtJL.Enabled = False
End If
End Sub
Private Sub ckName_Click()
If ckName.Value Then
txtName.Enabled = True
Else
txtName.Enabled = False
End If
End Sub
Private Sub ckSex_Click()
If ckSex.Value Then
cmSex.Enabled = True
Else
cmSex.Enabled = False
End If
End Sub
Private Sub ckYX_Click()
If ckYX.Value Then
dtYX.Enabled = True
Else
dtYX.Enabled = False
End If
End Sub
Private Sub cmdExit_Click()
MDIForm1.StatusBar1.Panels(1).Text = ""
Unload Me
End Sub
Private Sub cmdOk_Click()
'點(diǎn)擊查詢按紐后首先清空駕駛員檔案列表
Call QingKong
Dim sql As String
Dim sname As String
If ckName.Value Then
sname = "姓名 like '" & txtName & "%'"
Else
sname = "姓名 like '%'"
End If
Dim ssex As String
If ckSex.Value Then
ssex = "性別 ='" & cmSex.Text & "'"
Else
ssex = "性別 like '%'"
End If
Dim sborn As String
If ckBorn.Value Then
sborn = "出生年月 between #" & dtStart.Month & "/" & dtStart.Day & "/" & dtStart.Year & "# and #" & dtEnd.Month & "/" & dtEnd.Day & "/" & dtEnd.Year & "#"
Else
sborn = "出生年月 like '%'"
End If
Dim sjl As String
If ckJL.Value Then
sjl = "駕齡>=" & txtJL & ""
Else
sjl = "駕齡 like '%'"
End If
Dim syx As String
If ckYX.Value Then
syx = "證件有效期 =#" & dtYX.Month & "/" & dtYX.Day & "/" & dtYX.Year & "#"
Else
syx = "證件有效期 like '%'"
End If
sql = "select * from 駕駛員檔案 where " & sname & "and " & ssex & "and " & sborn & "and " & sjl & "and " & syx
If sql = "select * from 駕駛員檔案 where 姓名 like '%'and 性別 like '%'and 出生年月 like '%'and 駕齡 like '%'and 證件有效期 like '%'" Then
'清空上一次的查詢記錄
Call QingKong
MsgBox "請選擇查詢條件", , "系統(tǒng)提示"
Exit Sub
End If
Set adors = adoCon.Execute(sql)
If adors.EOF Then
Call QingKong
MsgBox "對不起,沒有符合您查詢的條件!", , "系統(tǒng)提示"
Else
Adodc1.RecordSource = sql
Adodc1.Refresh
End If
adors.Close
ckName.Value = 0
ckSex.Value = 0
ckBorn.Value = 0
ckYX.Value = 0
ckJL.Value = 0
End Sub
Private Sub Form_Load()
frmDrivercha.Width = 7815
frmDrivercha.Height = 4440
cmSex.ListIndex = 0
Call Rebind
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 0=1"
Adodc1.Refresh
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
cmdExit_Click
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -