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

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