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