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

📄 frmdrivercha.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 frmDrivercha 
   Caption         =   "驾驶员档案查询"
   ClientHeight    =   4035
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   7695
   Icon            =   "frmDrivercha.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MDIChild        =   -1  'True
   ScaleHeight     =   4035
   ScaleWidth      =   7695
   Begin VB.Frame Frame2 
      Caption         =   "Frame2"
      Height          =   2265
      Left            =   45
      TabIndex        =   13
      Top             =   1680
      Width           =   7560
      Begin MSAdodcLib.Adodc Adodc1 
         Height          =   375
         Left            =   3600
         Top             =   960
         Visible         =   0   'False
         Width           =   2295
         _ExtentX        =   4048
         _ExtentY        =   661
         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    =   ""
         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          =   1935
         Left            =   105
         TabIndex        =   14
         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 MSComCtl2.DTPicker DTyx 
         Height          =   315
         Left            =   4785
         TabIndex        =   15
         Top             =   615
         Width           =   1365
         _ExtentX        =   2408
         _ExtentY        =   556
         _Version        =   393216
         Enabled         =   0   'False
         Format          =   24838145
         CurrentDate     =   39083
      End
      Begin VB.TextBox txtJL 
         Enabled         =   0   'False
         Height          =   300
         Left            =   4785
         TabIndex        =   12
         Top             =   255
         Width           =   1335
      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          =   24838145
         CurrentDate     =   39151
      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          =   24838145
         CurrentDate     =   39148
      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":1C7A
         Left            =   1740
         List            =   "frmDrivercha.frx":1C84
         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            =   3450
         TabIndex        =   4
         Top             =   630
         Width           =   1575
      End
      Begin VB.CheckBox ckBorn 
         Caption         =   "出生年月:"
         Height          =   255
         Left            =   195
         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.Image Imgexit 
         Height          =   345
         Left            =   6390
         Picture         =   "frmDrivercha.frx":1C90
         Stretch         =   -1  'True
         Top             =   990
         Width           =   1005
      End
      Begin VB.Image Imgcha 
         Height          =   350
         Left            =   6375
         Picture         =   "frmDrivercha.frx":5C62
         Stretch         =   -1  'True
         Top             =   240
         Width           =   1000
      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
'*************************************************************************
'**模 块 名:frmDrivercha
'**版权说明:吉林省明日科技有限公司享有本软件的所有版权,如果本软件用于商
'**          业用途,必须经过吉林省明日科技有限公司授权。如果提供网上免费
'**          下载,必须经过吉林省明日科技有限公司授权,并保证程序的完整,
'**          不得修改代码、注释和相关内容,否则,我公司将追究其法律责任
'**网    址:www.mingrisoft.com  价值无限,服务无限
'**电    话:(0431)84978981,84978982
'**创 建 人:明日科技
'**日    期:2007-10-31
'**修 改 人:mraj
'**日    期:2007-10-31
'**描    述:
'*************************************************************************
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 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
    Set DataGrid1.DataSource = Adodc1
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 驾驶员档案 "
    Adodc1.Refresh
    Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    Imgexit_Click
End Sub
Private Sub Imgcha_Click()  '查询
    '点击查询按纽后首先清空驾驶员档案列表
    Call QingKong
    DataGrid1.SetFocus
    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 & "#"
       aa = "证件有效期 =" + Chr(35) + str(DTyx.Value) + Chr(35)
'       syx = "证件有效期 =" & Chr(35) + str(DTyx.Value) + Chr(35)
        syx = aa
       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 "请选择查询条件", , "车辆管理系统"
        Exit Sub
   Else
    Call main1
    Set adors = adoCon.Execute(sql)
    If adors.EOF Then
        Call QingKong
        MsgBox "对不起,没有符合该查询条件的驾驶员档案信息!", , "车辆管理系统"
    Else
        Adodc1.RecordSource = sql
        Adodc1.Refresh
        Set DataGrid1.DataSource = Adodc1
    End If
    End If
    adors.Close
    adoCon.Close
    ckName.Value = 0
    ckSex.Value = 0
    ckBorn.Value = 0
    ckYX.Value = 0
    ckJL.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 + -