frmcarWZcha.frm
上传用户:naidiweb
上传日期:2013-08-15
资源大小:672k
文件大小:14k
开发平台:

WORD

  1. VERSION 5.00
  2. Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
  3. Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
  4. Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
  5. Begin VB.Form frmcarWZcha 
  6.    Caption         =   "车辆违章查询"
  7.    ClientHeight    =   3990
  8.    ClientLeft      =   60
  9.    ClientTop       =   345
  10.    ClientWidth     =   6330
  11.    LinkTopic       =   "Form1"
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   3990
  14.    ScaleWidth      =   6330
  15.    Begin VB.Frame Frame2 
  16.       Caption         =   "Frame2"
  17.       Height          =   2100
  18.       Left            =   60
  19.       TabIndex        =   8
  20.       Top             =   1785
  21.       Width           =   6105
  22.       Begin MSAdodcLib.Adodc Adodc1 
  23.          Height          =   495
  24.          Left            =   3945
  25.          Top             =   735
  26.          Visible         =   0   'False
  27.          Width           =   1575
  28.          _ExtentX        =   2778
  29.          _ExtentY        =   873
  30.          ConnectMode     =   0
  31.          CursorLocation  =   3
  32.          IsolationLevel  =   -1
  33.          ConnectionTimeout=   15
  34.          CommandTimeout  =   30
  35.          CursorType      =   3
  36.          LockType        =   3
  37.          CommandType     =   1
  38.          CursorOptions   =   0
  39.          CacheSize       =   50
  40.          MaxRecords      =   0
  41.          BOFAction       =   0
  42.          EOFAction       =   0
  43.          ConnectStringType=   1
  44.          Appearance      =   1
  45.          BackColor       =   -2147483643
  46.          ForeColor       =   -2147483640
  47.          Orientation     =   0
  48.          Enabled         =   -1
  49.          Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
  50.          OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
  51.          OLEDBFile       =   ""
  52.          DataSourceName  =   ""
  53.          OtherAttributes =   ""
  54.          UserName        =   ""
  55.          Password        =   ""
  56.          RecordSource    =   "select * from 车辆违章表"
  57.          Caption         =   "Adodc1"
  58.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  59.             Name            =   "宋体"
  60.             Size            =   9
  61.             Charset         =   134
  62.             Weight          =   400
  63.             Underline       =   0   'False
  64.             Italic          =   0   'False
  65.             Strikethrough   =   0   'False
  66.          EndProperty
  67.          _Version        =   393216
  68.       End
  69.       Begin MSDataGridLib.DataGrid DataGrid1 
  70.          Bindings        =   "frmcarWZcha.frx":0000
  71.          Height          =   1755
  72.          Left            =   105
  73.          TabIndex        =   9
  74.          Top             =   210
  75.          Width           =   5865
  76.          _ExtentX        =   10345
  77.          _ExtentY        =   3096
  78.          _Version        =   393216
  79.          AllowUpdate     =   0   'False
  80.          HeadLines       =   1
  81.          RowHeight       =   15
  82.          FormatLocked    =   -1  'True
  83.          BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  84.             Name            =   "宋体"
  85.             Size            =   9
  86.             Charset         =   134
  87.             Weight          =   400
  88.             Underline       =   0   'False
  89.             Italic          =   0   'False
  90.             Strikethrough   =   0   'False
  91.          EndProperty
  92.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  93.             Name            =   "宋体"
  94.             Size            =   9
  95.             Charset         =   134
  96.             Weight          =   400
  97.             Underline       =   0   'False
  98.             Italic          =   0   'False
  99.             Strikethrough   =   0   'False
  100.          EndProperty
  101.          ColumnCount     =   5
  102.          BeginProperty Column00 
  103.             DataField       =   "车牌号码"
  104.             Caption         =   "车牌号码"
  105.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  106.                Type            =   0
  107.                Format          =   ""
  108.                HaveTrueFalseNull=   0
  109.                FirstDayOfWeek  =   0
  110.                FirstWeekOfYear =   0
  111.                LCID            =   2052
  112.                SubFormatType   =   0
  113.             EndProperty
  114.          EndProperty
  115.          BeginProperty Column01 
  116.             DataField       =   "原因"
  117.             Caption         =   "原因"
  118.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  119.                Type            =   0
  120.                Format          =   ""
  121.                HaveTrueFalseNull=   0
  122.                FirstDayOfWeek  =   0
  123.                FirstWeekOfYear =   0
  124.                LCID            =   2052
  125.                SubFormatType   =   0
  126.             EndProperty
  127.          EndProperty
  128.          BeginProperty Column02 
  129.             DataField       =   "处罚"
  130.             Caption         =   "处罚"
  131.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  132.                Type            =   0
  133.                Format          =   ""
  134.                HaveTrueFalseNull=   0
  135.                FirstDayOfWeek  =   0
  136.                FirstWeekOfYear =   0
  137.                LCID            =   2052
  138.                SubFormatType   =   0
  139.             EndProperty
  140.          EndProperty
  141.          BeginProperty Column03 
  142.             DataField       =   "违章时间"
  143.             Caption         =   "违章时间"
  144.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  145.                Type            =   0
  146.                Format          =   ""
  147.                HaveTrueFalseNull=   0
  148.                FirstDayOfWeek  =   0
  149.                FirstWeekOfYear =   0
  150.                LCID            =   2052
  151.                SubFormatType   =   0
  152.             EndProperty
  153.          EndProperty
  154.          BeginProperty Column04 
  155.             DataField       =   "备注"
  156.             Caption         =   "备注"
  157.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  158.                Type            =   0
  159.                Format          =   ""
  160.                HaveTrueFalseNull=   0
  161.                FirstDayOfWeek  =   0
  162.                FirstWeekOfYear =   0
  163.                LCID            =   2052
  164.                SubFormatType   =   0
  165.             EndProperty
  166.          EndProperty
  167.          SplitCount      =   1
  168.          BeginProperty Split0 
  169.             BeginProperty Column00 
  170.                ColumnWidth     =   854.929
  171.             EndProperty
  172.             BeginProperty Column01 
  173.                ColumnWidth     =   1335.118
  174.             EndProperty
  175.             BeginProperty Column02 
  176.                ColumnWidth     =   524.976
  177.             EndProperty
  178.             BeginProperty Column03 
  179.                ColumnWidth     =   1080
  180.             EndProperty
  181.             BeginProperty Column04 
  182.                ColumnWidth     =   1665.071
  183.             EndProperty
  184.          EndProperty
  185.       End
  186.    End
  187.    Begin VB.Frame Frame1 
  188.       Caption         =   "  查询条件"
  189.       ForeColor       =   &H00FF0000&
  190.       Height          =   1575
  191.       Left            =   60
  192.       TabIndex        =   0
  193.       Top             =   120
  194.       Width           =   6105
  195.       Begin VB.CommandButton cmdExit 
  196.          Caption         =   "退 出(&E)"
  197.          Height          =   345
  198.          Left            =   5010
  199.          TabIndex        =   11
  200.          Top             =   1050
  201.          Width           =   975
  202.       End
  203.       Begin VB.CommandButton cmdCha 
  204.          Caption         =   "查 询(&F)"
  205.          Height          =   330
  206.          Left            =   5010
  207.          TabIndex        =   10
  208.          Top             =   300
  209.          Width           =   975
  210.       End
  211.       Begin VB.CheckBox ckcp 
  212.          Caption         =   "车牌号码:"
  213.          Height          =   255
  214.          Left            =   240
  215.          TabIndex        =   5
  216.          Top             =   300
  217.          Width           =   1215
  218.       End
  219.       Begin VB.CheckBox cktime 
  220.          Caption         =   "违章时间:"
  221.          Height          =   180
  222.          Left            =   240
  223.          TabIndex        =   4
  224.          Top             =   1140
  225.          Width           =   1215
  226.       End
  227.       Begin VB.ComboBox cmCP 
  228.          Enabled         =   0   'False
  229.          Height          =   300
  230.          Left            =   1785
  231.          TabIndex        =   3
  232.          Top             =   300
  233.          Width           =   1845
  234.       End
  235.       Begin VB.CheckBox ckcf 
  236.          Caption         =   "处    罚:"
  237.          Height          =   255
  238.          Left            =   240
  239.          TabIndex        =   2
  240.          Top             =   675
  241.          Width           =   1215
  242.       End
  243.       Begin VB.TextBox txtCF 
  244.          Enabled         =   0   'False
  245.          Height          =   300
  246.          Left            =   1785
  247.          TabIndex        =   1
  248.          Top             =   675
  249.          Width           =   1845
  250.       End
  251.       Begin MSComCtl2.DTPicker dtEnd 
  252.          Height          =   300
  253.          Left            =   3555
  254.          TabIndex        =   12
  255.          Top             =   1080
  256.          Width           =   1335
  257.          _ExtentX        =   2355
  258.          _ExtentY        =   529
  259.          _Version        =   393216
  260.          Enabled         =   0   'False
  261.          Format          =   26869761
  262.          CurrentDate     =   38053
  263.       End
  264.       Begin MSComCtl2.DTPicker dtStart 
  265.          Height          =   300
  266.          Left            =   1785
  267.          TabIndex        =   13
  268.          Top             =   1080
  269.          Width           =   1335
  270.          _ExtentX        =   2355
  271.          _ExtentY        =   529
  272.          _Version        =   393216
  273.          Enabled         =   0   'False
  274.          Format          =   26869761
  275.          CurrentDate     =   38053
  276.       End
  277.       Begin VB.Label Label6 
  278.          Caption         =   "从"
  279.          ForeColor       =   &H00FF0000&
  280.          Height          =   255
  281.          Left            =   1500
  282.          TabIndex        =   7
  283.          Top             =   1155
  284.          Width           =   255
  285.       End
  286.       Begin VB.Label Label5 
  287.          Caption         =   "到"
  288.          ForeColor       =   &H00FF0000&
  289.          Height          =   255
  290.          Left            =   3240
  291.          TabIndex        =   6
  292.          Top             =   1155
  293.          Width           =   255
  294.       End
  295.    End
  296. End
  297. Attribute VB_Name = "frmcarWZcha"
  298. Attribute VB_GlobalNameSpace = False
  299. Attribute VB_Creatable = False
  300. Attribute VB_PredeclaredId = True
  301. Attribute VB_Exposed = False
  302. Private Sub ckcp_Click()
  303.     If ckcp.Value Then
  304.         cmCP.Enabled = True
  305.     Else
  306.         cmCP.Enabled = False
  307.     End If
  308. End Sub
  309. Private Sub ckcf_Click()
  310.     If ckcf.Value Then
  311.         txtCF.Enabled = True
  312.     Else
  313.         txtCF.Enabled = False
  314.     End If
  315. End Sub
  316. Private Sub cktime_Click()
  317.     If cktime.Value Then
  318.         dtStart.Enabled = True
  319.         dtEnd.Enabled = True
  320.     Else
  321.         dtStart.Enabled = False
  322.         dtEnd.Enabled = False
  323.     End If
  324. End Sub
  325. Private Sub cmdCha_Click()
  326.     '点击查询按纽后首先清空车辆档案列表
  327.     Call QingKong
  328.     Dim sql As String
  329.     Dim scp As String
  330.     If ckcp.Value Then
  331.         scp = "车牌号码 like '" & cmCP.Text & "%'"
  332.     Else
  333.         scp = "车牌号码 like '%'"
  334.     End If
  335.     
  336.     Dim stime As String
  337.     If cktime.Value Then
  338.         stime = "违章时间 between #" & dtStart.Month & "/" & dtStart.Day & "/" & dtStart.Year & "# and #" & dtEnd.Month & "/" & dtEnd.Day & "/" & dtEnd.Year & "#"
  339.         Else
  340.         stime = "违章时间 like '%'"
  341.     End If
  342.     Dim scf As String
  343.     If ckcf.Value Then
  344.         txtCF.Enabled = True
  345.         scf = "处罚 like '" & txtCF & "%'"
  346.     Else
  347.         scf = "处罚 like '%'"
  348.     End If
  349.     
  350.     sql = "select * from 车辆违章表 where " & scp & "and " & stime & "and " & scf
  351.     'MsgBox sql
  352.     
  353.     
  354.     If sql = "select * from 车辆违章表 where 车牌号码 like '%'and 违章时间 like '%'and 处罚 like '%'" Then
  355.         Call QingKong
  356.         MsgBox "请选择查询条件", , "系统提示"
  357.         Exit Sub
  358.     End If
  359.     
  360.     Set adors = adoCon.Execute(sql)
  361.     
  362.     If adors.EOF Then
  363.         Call QingKong
  364.         MsgBox "对不起,没有符合您查询条件的车辆违章记录!", , "系统提示"
  365.         
  366.     Else
  367.        Adodc1.RecordSource = sql
  368.        Adodc1.Refresh
  369.     End If
  370.     adors.Close
  371.     ckcp.Value = 0
  372.     cktime.Value = 0
  373.     ckcf.Value = 0
  374. End Sub
  375. Private Sub cmdExit_Click()
  376.     MDIForm1.StatusBar1.Panels(1).Text = ""
  377.     Unload Me
  378. End Sub
  379. Private Sub Form_Load()
  380.     frmcarWZcha.Width = 6450
  381.     frmcarWZcha.Height = 4395
  382.     Call Rebind
  383.    'add all cp in the table carWZ
  384.     Set adors = adoCon.Execute("select distinct 车牌号码 from 车辆违章表")
  385.     On Error Resume Next
  386.     Do
  387.         cmCP.AddItem adors.Fields(0)
  388.         adors.MoveNext
  389.     Loop Until adors.EOF
  390.     adors.Close
  391.     
  392. End Sub
  393. Private Sub Rebind()
  394.     Frame2.Caption = "车辆违章列表"
  395.     Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "clgl.mdb;Persist Security Info=False"
  396.     Adodc1.RecordSource = "select * from 车辆违章表"
  397.     Adodc1.Refresh
  398. End Sub
  399. Private Sub QingKong()
  400.     Frame2.Caption = "您所要查询的车辆违章记录如下:"
  401.     Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "clgl.mdb;Persist Security Info=False"
  402.     Adodc1.RecordSource = "select * from 车辆违章表 where 1=0"
  403.     Adodc1.Refresh
  404. End Sub
  405. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  406.     cmdExit_Click
  407. End Sub