frmcardacha.frm
资源名称:0123..rar [点击查看]
上传用户:naidiweb
上传日期:2013-08-15
资源大小:672k
文件大小:18k
源码类别:
软件设计/软件工程
开发平台:
WORD
- VERSION 5.00
- 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 frmcarDAcha
- BackColor = &H8000000A&
- Caption = "车辆档案查询"
- ClientHeight = 4665
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 7815
- ForeColor = &H00808080&
- LinkTopic = "Form1"
- MDIChild = -1 'True
- ScaleHeight = 4665
- ScaleWidth = 7815
- Begin VB.Frame Frame2
- Caption = "Frame2"
- ForeColor = &H00FF0000&
- Height = 2505
- Left = 105
- TabIndex = 17
- Top = 60
- Width = 7515
- Begin MSAdodcLib.Adodc Adodc3
- Height = 345
- Left = 690
- Top = 1500
- Visible = 0 'False
- Width = 2655
- _ExtentX = 4683
- _ExtentY = 609
- 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 MSAdodcLib.Adodc Adodc2
- Height = 345
- Left = 2430
- Top = 870
- Visible = 0 'False
- Width = 2655
- _ExtentX = 4683
- _ExtentY = 609
- 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 MSAdodcLib.Adodc Adodc1
- Height = 345
- Left = 3225
- Top = 1650
- Visible = 0 'False
- Width = 2655
- _ExtentX = 4683
- _ExtentY = 609
- 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 = "frmcardacha.frx":0000
- Height = 2055
- Left = 90
- TabIndex = 18
- Top = 285
- Width = 7290
- _ExtentX = 12859
- _ExtentY = 3625
- _Version = 393216
- AllowUpdate = 0 'False
- BackColor = -2147483624
- 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.CommandButton cmdCha
- Caption = "车辆档案查询"
- Height = 360
- Left = 6090
- TabIndex = 16
- Top = 2775
- Width = 1575
- End
- Begin VB.CommandButton cmdExit
- Caption = "退 出(&E)"
- Height = 375
- Left = 6090
- TabIndex = 15
- Top = 4215
- Width = 1575
- End
- Begin VB.CommandButton cmdAll
- Caption = "显示所有车辆档案"
- Height = 375
- Left = 6090
- TabIndex = 14
- Top = 2775
- Width = 1575
- End
- Begin VB.Frame Frame1
- Caption = "查询条件"
- Enabled = 0 'False
- ForeColor = &H00FF0000&
- Height = 1935
- Left = 90
- TabIndex = 1
- Top = 2670
- Width = 5895
- Begin VB.CheckBox ckbf
- Caption = "报废:"
- Height = 180
- Left = 3840
- TabIndex = 13
- Top = 1440
- Width = 855
- End
- Begin VB.CheckBox ckyd
- Caption = "异动:"
- Height = 180
- Left = 3840
- TabIndex = 12
- Top = 960
- Width = 855
- End
- Begin VB.CheckBox ckbx
- Caption = "保险:"
- Height = 255
- Left = 3840
- TabIndex = 11
- Top = 480
- Width = 855
- End
- Begin VB.CheckBox ckdw
- Caption = "车辆所在单位:"
- Height = 255
- Left = 240
- TabIndex = 10
- Top = 1440
- Width = 1575
- End
- Begin VB.CheckBox cklx
- Caption = "车辆类型:"
- Height = 255
- Left = 240
- TabIndex = 9
- Top = 960
- Width = 1215
- End
- Begin VB.CheckBox ckcp
- Caption = "车牌号码:"
- Height = 255
- Left = 240
- TabIndex = 8
- Top = 480
- Width = 1215
- End
- Begin VB.ComboBox Combo6
- Enabled = 0 'False
- Height = 300
- ItemData = "frmcardacha.frx":0015
- Left = 4680
- List = "frmcardacha.frx":001F
- TabIndex = 7
- Top = 1440
- Width = 975
- End
- Begin VB.ComboBox Combo5
- Enabled = 0 'False
- Height = 300
- ItemData = "frmcardacha.frx":002B
- Left = 4680
- List = "frmcardacha.frx":0035
- TabIndex = 6
- Top = 960
- Width = 975
- End
- Begin VB.ComboBox Combo4
- Enabled = 0 'False
- Height = 300
- ItemData = "frmcardacha.frx":0041
- Left = 4680
- List = "frmcardacha.frx":004B
- TabIndex = 5
- Top = 480
- Width = 975
- End
- Begin VB.ComboBox Combo3
- Enabled = 0 'False
- Height = 300
- Left = 1800
- TabIndex = 4
- Top = 1440
- Width = 1695
- End
- Begin VB.ComboBox Combo2
- Enabled = 0 'False
- Height = 300
- Left = 1800
- TabIndex = 3
- Top = 960
- Width = 1695
- End
- Begin VB.ComboBox Combo1
- Enabled = 0 'False
- Height = 300
- Left = 1800
- TabIndex = 2
- Top = 480
- Width = 1695
- End
- End
- Begin VB.CommandButton cmdOk
- Caption = " 查 询(&F)"
- Enabled = 0 'False
- Height = 375
- Left = 6090
- TabIndex = 0
- Top = 3495
- Width = 1575
- End
- End
- Attribute VB_Name = "frmcardacha"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub ckbf_Click()
- If ckbf.Value Then
- Combo6.Enabled = True
- Else
- Combo6.Enabled = False
- End If
- End Sub
- Private Sub ckbx_Click()
- If ckbx.Value Then
- Combo4.Enabled = True
- Else
- Combo4.Enabled = False
- End If
- End Sub
- Private Sub ckcp_Click()
- If ckcp.Value Then
- Combo1.Enabled = True
- Else
- Combo1.Enabled = False
- End If
- End Sub
- Private Sub ckdw_Click()
- If ckdw.Value Then
- Combo3.Enabled = True
- Else
- Combo3.Enabled = False
- End If
- End Sub
- Private Sub cklx_Click()
- If cklx.Value Then
- Combo2.Enabled = True
- Else
- Combo2.Enabled = False
- End If
- End Sub
- Private Sub ckyd_Click()
- If ckyd.Value Then
- Combo5.Enabled = True
- Else
- Combo5.Enabled = False
- End If
- End Sub
- Private Sub cmdAll_Click()
- Frame1.Enabled = False
- ckcp.Value = 0
- cklx.Value = 0
- ckdw.Value = 0
- ckbx.Value = 0
- ckyd.Value = 0
- ckbf.Value = 0
- Call Rebind
- cmdCha.Visible = True
- cmdAll.Visible = False
- cmdok.Enabled = False
- End Sub
- Private Sub cmdExit_Click()
- MDIForm1.StatusBar1.Panels(1).Text = ""
- Unload Me
- End Sub
- Private Sub cmdCha_Click()
- '点击查询按纽后首先清空车辆档案列表
- Call QingKong
- cmdCha.Visible = False
- cmdAll.Visible = True
- Frame1.Enabled = True
- cmdok.Enabled = True
- End Sub
- Private Sub cmdOk_Click()
- Dim sql As String
- Dim scp As String
- If ckcp.Value Then
- scp = "车牌号码 like '" & Combo1.Text & "%'"
- Else
- scp = "车牌号码 like '%'"
- End If
- Dim slx As String
- If cklx.Value Then
- slx = "车辆类型 like'%" & Combo2.Text & "%'"
- Else
- slx = "车辆类型 like '%'"
- End If
- Dim sdw As String
- If ckdw.Value Then
- sdw = "车辆所在单位 like'%" & Combo3.Text & "%'"
- Else
- sdw = "车辆所在单位 like '%'"
- End If
- Dim sbx As String
- If ckbx.Value Then
- sbx = "保险否='" & Combo4.Text & "'"
- Else
- sbx = "保险否 like '%'"
- End If
- Dim syd As String
- If ckyd.Value Then
- syd = "异动否='" & Combo5.Text & "'"
- Else
- syd = "异动否 like '%'"
- End If
- Dim sbf As String
- If ckbf.Value Then
- sbf = " 报废否='" & Combo6.Text & "'"
- Else
- sbf = "报废否 like '%'"
- End If
- sql = "select * from 车辆档案 where " & scp & "and " & slx & "and " & sdw & "and " & sbx & "and " & syd & "and " & sbf
- 'MsgBox sql
- If sql = "select * from 车辆档案 where 车牌号码 like '%'and 车辆类型 like '%'and 车辆所在单位 like '%'and 保险否 like '%'and 异动否 like '%'and 报废否 like '%'" Then
- MsgBox "请选择查询条件", , "系统提示"
- '清空上一次的查询记录
- Call QingKong
- 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
- cklx.Value = 0
- ckdw.Value = 0
- ckbx.Value = 0
- ckyd.Value = 0
- ckbf.Value = 0
- End Sub
- Private Sub Form_Load()
- Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "clgl.mdb;Persist Security Info=False"
- Call Rebind
- cmdAll.Visible = False
- cmdCha.Visible = True
- cmdok.Enabled = False
- frmcardacha.Height = 5070
- frmcardacha.Width = 7935
- '将表里存在的所有车牌加到控件combo1里
- On Error Resume Next
- Adodc1.RecordSource = "select distinct 车牌号码 from 车辆档案"
- Do
- Combo1.AddItem Adodc1.Recordset.Fields(0)
- Adodc1.Recordset.MoveNext
- Loop Until Adodc1.Recordset.EOF
- Adodc1.Refresh
- Adodc2.RecordSource = "select distinct 车辆类型 from 车辆档案"
- Adodc2.Refresh
- Do
- Combo2.AddItem Adodc2.Recordset.Fields(0)
- Adodc2.Recordset.MoveNext
- Loop Until Adodc2.Recordset.EOF
- Adodc3.RecordSource = "select distinct 车辆所在单位 from 车辆档案"
- Adodc3.Refresh
- Do
- Combo3.AddItem Adodc3.Recordset.Fields(0)
- Adodc3.Recordset.MoveNext
- Loop Until Adodc3.Recordset.EOF
- Adodc1.RecordSource = "select * from 车辆档案"
- Adodc1.Refresh
- End Sub
- Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
- cmdExit_Click
- 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 = "您所要查询的车辆档案如下:"
- '清空datagrid1控件里的记录
- 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