⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmcarwzcha.frm

📁 车辆管理系统
💻 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 frmcarWZcha 
   Caption         =   "车辆违章查询"
   ClientHeight    =   3990
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6330
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   3990
   ScaleWidth      =   6330
   Begin VB.Frame Frame2 
      Caption         =   "Frame2"
      Height          =   2100
      Left            =   60
      TabIndex        =   8
      Top             =   1785
      Width           =   6105
      Begin MSAdodcLib.Adodc Adodc1 
         Height          =   495
         Left            =   3945
         Top             =   735
         Visible         =   0   'False
         Width           =   1575
         _ExtentX        =   2778
         _ExtentY        =   873
         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        =   "frmcarWZcha.frx":0000
         Height          =   1755
         Left            =   105
         TabIndex        =   9
         Top             =   210
         Width           =   5865
         _ExtentX        =   10345
         _ExtentY        =   3096
         _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     =   854.929
            EndProperty
            BeginProperty Column01 
               ColumnWidth     =   1335.118
            EndProperty
            BeginProperty Column02 
               ColumnWidth     =   524.976
            EndProperty
            BeginProperty Column03 
               ColumnWidth     =   1080
            EndProperty
            BeginProperty Column04 
               ColumnWidth     =   1665.071
            EndProperty
         EndProperty
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "  查询条件"
      ForeColor       =   &H00FF0000&
      Height          =   1575
      Left            =   60
      TabIndex        =   0
      Top             =   120
      Width           =   6105
      Begin VB.CommandButton cmdExit 
         Caption         =   "退 出(&E)"
         Height          =   345
         Left            =   5010
         TabIndex        =   11
         Top             =   1050
         Width           =   975
      End
      Begin VB.CommandButton cmdCha 
         Caption         =   "查 询(&F)"
         Height          =   330
         Left            =   5010
         TabIndex        =   10
         Top             =   300
         Width           =   975
      End
      Begin VB.CheckBox ckcp 
         Caption         =   "车牌号码:"
         Height          =   255
         Left            =   240
         TabIndex        =   5
         Top             =   300
         Width           =   1215
      End
      Begin VB.CheckBox cktime 
         Caption         =   "违章时间:"
         Height          =   180
         Left            =   240
         TabIndex        =   4
         Top             =   1140
         Width           =   1215
      End
      Begin VB.ComboBox cmCP 
         Enabled         =   0   'False
         Height          =   300
         Left            =   1785
         TabIndex        =   3
         Top             =   300
         Width           =   1845
      End
      Begin VB.CheckBox ckcf 
         Caption         =   "处    罚:"
         Height          =   255
         Left            =   240
         TabIndex        =   2
         Top             =   675
         Width           =   1215
      End
      Begin VB.TextBox txtCF 
         Enabled         =   0   'False
         Height          =   300
         Left            =   1785
         TabIndex        =   1
         Top             =   675
         Width           =   1845
      End
      Begin MSComCtl2.DTPicker dtEnd 
         Height          =   300
         Left            =   3555
         TabIndex        =   12
         Top             =   1080
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   529
         _Version        =   393216
         Enabled         =   0   'False
         Format          =   26869761
         CurrentDate     =   38053
      End
      Begin MSComCtl2.DTPicker dtStart 
         Height          =   300
         Left            =   1785
         TabIndex        =   13
         Top             =   1080
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   529
         _Version        =   393216
         Enabled         =   0   'False
         Format          =   26869761
         CurrentDate     =   38053
      End
      Begin VB.Label Label6 
         Caption         =   "从"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   1500
         TabIndex        =   7
         Top             =   1155
         Width           =   255
      End
      Begin VB.Label Label5 
         Caption         =   "到"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   3240
         TabIndex        =   6
         Top             =   1155
         Width           =   255
      End
   End
End
Attribute VB_Name = "frmcarWZcha"
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 ckcf_Click()
    If ckcf.Value Then
        txtCF.Enabled = True
    Else
        txtCF.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 scf As String
    If ckcf.Value Then
        txtCF.Enabled = True
        scf = "处罚 like '" & txtCF & "%'"
    Else
        scf = "处罚 like '%'"
    End If
    
    sql = "select * from 车辆违章表 where " & scp & "and " & stime & "and " & scf
    'MsgBox sql
    
    
    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
    ckcf.Value = 0
End Sub

Private Sub cmdExit_Click()
    MDIForm1.StatusBar1.Panels(1).Text = ""
    Unload Me
End Sub
Private Sub Form_Load()
    frmcarWZcha.Width = 6450
    frmcarWZcha.Height = 4395
    Call Rebind
   'add all cp in the table carWZ
    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
    
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 + -