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

📄 frmcarbfcha.frm

📁 用VB开发的车辆数据库管理系统
💻 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 frmcarBFcha 
   Caption         =   "车辆报废查询"
   ClientHeight    =   3690
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5610
   Icon            =   "frmcarBFcha.frx":0000
   LinkTopic       =   "Form7"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   ScaleHeight     =   3690
   ScaleWidth      =   5610
   Begin VB.Frame Frame1 
      Caption         =   "  查询条件"
      ForeColor       =   &H00FF0000&
      Height          =   3180
      Left            =   30
      TabIndex        =   0
      Top             =   45
      Width           =   5520
      Begin VB.CheckBox ckcp 
         Caption         =   "车牌号码:"
         Height          =   255
         Left            =   120
         TabIndex        =   7
         Top             =   360
         Width           =   1215
      End
      Begin VB.CheckBox cktime 
         Caption         =   "报废日期:"
         Height          =   180
         Left            =   120
         TabIndex        =   6
         Top             =   825
         Width           =   1215
      End
      Begin VB.CheckBox ckyy 
         Caption         =   "报废原因:"
         Height          =   255
         Left            =   120
         TabIndex        =   5
         Top             =   1260
         Width           =   1215
      End
      Begin VB.ComboBox cmcp 
         Enabled         =   0   'False
         Height          =   300
         Left            =   1320
         TabIndex        =   4
         Top             =   315
         Width           =   4035
      End
      Begin VB.ComboBox cmyy 
         Enabled         =   0   'False
         Height          =   300
         Left            =   1320
         TabIndex        =   3
         Top             =   1260
         Width           =   4035
      End
      Begin MSComCtl2.DTPicker dtEnd 
         Height          =   300
         Left            =   3705
         TabIndex        =   1
         Top             =   780
         Width           =   1620
         _ExtentX        =   2858
         _ExtentY        =   529
         _Version        =   393216
         Enabled         =   0   'False
         Format          =   24903681
         CurrentDate     =   39148
      End
      Begin MSComCtl2.DTPicker dtStart 
         Height          =   300
         Left            =   1560
         TabIndex        =   2
         Top             =   780
         Width           =   1620
         _ExtentX        =   2858
         _ExtentY        =   529
         _Version        =   393216
         Enabled         =   0   'False
         Format          =   24903681
         CurrentDate     =   39148
      End
      Begin MSAdodcLib.Adodc Adodc1 
         Height          =   345
         Left            =   1050
         Top             =   2475
         Visible         =   0   'False
         Width           =   2325
         _ExtentX        =   4101
         _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 MSDataGridLib.DataGrid DataGrid1 
         Height          =   1215
         Left            =   90
         TabIndex        =   10
         Top             =   1890
         Width           =   5340
         _ExtentX        =   9419
         _ExtentY        =   2143
         _Version        =   393216
         AllowUpdate     =   0   'False
         ForeColor       =   32768
         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
      Begin VB.Label Label1 
         Caption         =   "查询记录显示:"
         ForeColor       =   &H00FF0000&
         Height          =   180
         Left            =   120
         TabIndex        =   11
         Top             =   1635
         Width           =   3735
      End
      Begin VB.Label Label6 
         Caption         =   "从"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   1320
         TabIndex        =   9
         Top             =   870
         Width           =   255
      End
      Begin VB.Label Label5 
         Caption         =   "到"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   3330
         TabIndex        =   8
         Top             =   870
         Width           =   255
      End
   End
   Begin VB.Image Imgexit 
      Height          =   330
      Left            =   4470
      Picture         =   "frmcarBFcha.frx":1C7A
      Stretch         =   -1  'True
      Top             =   3285
      Width           =   1050
   End
   Begin VB.Image Imgcha 
      Height          =   330
      Left            =   3405
      Picture         =   "frmcarBFcha.frx":5C4C
      Stretch         =   -1  'True
      Top             =   3285
      Width           =   1050
   End
End
Attribute VB_Name = "frmcarBFcha"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*************************************************************************
'**模 块 名:frmcarBFcha
'**版权说明:吉林省明日科技有限公司享有本软件的所有版权,如果本软件用于商
'**          业用途,必须经过吉林省明日科技有限公司授权。如果提供网上免费
'**          下载,必须经过吉林省明日科技有限公司授权,并保证程序的完整,
'**          不得修改代码、注释和相关内容,否则,我公司将追究其法律责任
'**网    址:www.mingrisoft.com  价值无限,服务无限
'**电    话:(0431)84978981,84978982
'**创 建 人:明日科技
'**日    期:2007-10-31
'**修 改 人:mraj
'**日    期:2007-10-31
'**描    述:
'*************************************************************************

Private Sub ckcp_Click()   '车牌号码
    If ckcp.Value Then
        cmCP.Enabled = True
    Else
        cmCP.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 ckyy_Click()     '报废原因
    If ckyy.Value Then
        cmyy.Enabled = True
    Else
        cmyy.Enabled = False
    End If
End Sub

Private Sub Form_Load()
    frmcarBFcha.Height = 4095
    frmcarBFcha.Width = 5730
    Label1.Caption = "车辆报废列表"
    Call Rebind
    '将车辆报废表里的车牌号码加到cmcp控件里
    Call main1
    Set adors = adoCon.Execute("select distinct 车牌号码,报废原因 from 车辆报废表")
    On Error Resume Next
    Do
        cmCP.AddItem adors.Fields(0)
        cmyy.AddItem adors.Fields(1)
        adors.MoveNext
    Loop Until adors.EOF
    adoCon.Close
    Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Rebind()
    Label1.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()
    Label1.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)
    Imgexit_Click
End Sub
Private Sub Imgcha_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 ckyy.Value Then
        syy = "报废原因 like'%" & cmyy.Text & "%'"
    Else
        syy = "报废原因 like '%'"
    End If
    sql = "select * from 车辆报废表 where " & scp & "and " & syy & "and " & stime
    '如果没有选择查询条件,那么清空上一次查询结果并给出对话框提示,退出查询过程
    If sql = "select * from 车辆报废表 where 车牌号码 like '%'and 报废原因 like '%'and 报废日期 like '%'" Then
        Call QingKong
        MsgBox "请选择查询条件", , "车辆管理系统"
        Exit Sub
    End If
    '返回符合查询条件的记录集

    Call main1
    Set adors = adoCon.Execute(sql)
    '如果记录集为空,说明没有符合条件的记录存在,清空上一次查询结果集并提示,
    '退出此次查询过程,否则在datagrid1控件里显示记录集
    If adors.EOF Then
        Call QingKong
        MsgBox "对不起,没有符合您查询条件的车辆!", , "车辆管理系统"
    Else
        Adodc1.RecordSource = sql
        Adodc1.Refresh
    End If
    adors.Close
    ckcp.Value = 0
    cktime.Value = 0
    ckyy.Value = 0
End Sub

Private Sub Imgexit_Click()  '退出
    MDIForm1.StatusBar1.Panels(1).Text = ""
    Unload Me
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -