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

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 frmcarSGcha 
  6.    Caption         =   "车辆事故记录查询窗体"
  7.    ClientHeight    =   3480
  8.    ClientLeft      =   60
  9.    ClientTop       =   345
  10.    ClientWidth     =   6255
  11.    FillColor       =   &H00FF0000&
  12.    LinkTopic       =   "Form1"
  13.    MDIChild        =   -1  'True
  14.    ScaleHeight     =   3480
  15.    ScaleWidth      =   6255
  16.    Begin VB.Frame Frame2 
  17.       Caption         =   "Frame2"
  18.       BeginProperty Font 
  19.          Name            =   "宋体"
  20.          Size            =   10.5
  21.          Charset         =   134
  22.          Weight          =   400
  23.          Underline       =   0   'False
  24.          Italic          =   0   'False
  25.          Strikethrough   =   0   'False
  26.       EndProperty
  27.       ForeColor       =   &H00FF0000&
  28.       Height          =   1995
  29.       Left            =   135
  30.       TabIndex        =   10
  31.       Top             =   1380
  32.       Width           =   5985
  33.       Begin MSAdodcLib.Adodc Adodc1 
  34.          Height          =   360
  35.          Left            =   1065
  36.          Top             =   765
  37.          Visible         =   0   'False
  38.          Width           =   2805
  39.          _ExtentX        =   4948
  40.          _ExtentY        =   635
  41.          ConnectMode     =   0
  42.          CursorLocation  =   3
  43.          IsolationLevel  =   -1
  44.          ConnectionTimeout=   15
  45.          CommandTimeout  =   30
  46.          CursorType      =   3
  47.          LockType        =   3
  48.          CommandType     =   1
  49.          CursorOptions   =   0
  50.          CacheSize       =   50
  51.          MaxRecords      =   0
  52.          BOFAction       =   0
  53.          EOFAction       =   0
  54.          ConnectStringType=   1
  55.          Appearance      =   1
  56.          BackColor       =   -2147483643
  57.          ForeColor       =   -2147483640
  58.          Orientation     =   0
  59.          Enabled         =   -1
  60.          Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
  61.          OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=clgl.mdb;Persist Security Info=False"
  62.          OLEDBFile       =   ""
  63.          DataSourceName  =   ""
  64.          OtherAttributes =   ""
  65.          UserName        =   ""
  66.          Password        =   ""
  67.          RecordSource    =   "select * from 车辆事故表"
  68.          Caption         =   "Adodc1"
  69.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  70.             Name            =   "宋体"
  71.             Size            =   9
  72.             Charset         =   134
  73.             Weight          =   400
  74.             Underline       =   0   'False
  75.             Italic          =   0   'False
  76.             Strikethrough   =   0   'False
  77.          EndProperty
  78.          _Version        =   393216
  79.       End
  80.       Begin MSDataGridLib.DataGrid DataGrid1 
  81.          Bindings        =   "frmcarSGcha.frx":0000
  82.          Height          =   1605
  83.          Left            =   135
  84.          TabIndex        =   11
  85.          Top             =   255
  86.          Width           =   5685
  87.          _ExtentX        =   10028
  88.          _ExtentY        =   2831
  89.          _Version        =   393216
  90.          AllowUpdate     =   0   'False
  91.          BackColor       =   16776960
  92.          ForeColor       =   8388608
  93.          HeadLines       =   1
  94.          RowHeight       =   15
  95.          FormatLocked    =   -1  'True
  96.          BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  97.             Name            =   "宋体"
  98.             Size            =   9
  99.             Charset         =   134
  100.             Weight          =   400
  101.             Underline       =   0   'False
  102.             Italic          =   0   'False
  103.             Strikethrough   =   0   'False
  104.          EndProperty
  105.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  106.             Name            =   "宋体"
  107.             Size            =   9
  108.             Charset         =   134
  109.             Weight          =   400
  110.             Underline       =   0   'False
  111.             Italic          =   0   'False
  112.             Strikethrough   =   0   'False
  113.          EndProperty
  114.          ColumnCount     =   14
  115.          BeginProperty Column00 
  116.             DataField       =   "事故编号"
  117.             Caption         =   "事故编号"
  118.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  119.                Type            =   0
  120.                Format          =   ""
  121.                HaveTrueFalseNull=   0
  122.                FirstDayOfWeek  =   0
  123.                FirstWeekOfYear =   0
  124.                LCID            =   2052
  125.                SubFormatType   =   0
  126.             EndProperty
  127.          EndProperty
  128.          BeginProperty Column01 
  129.             DataField       =   "车牌号码"
  130.             Caption         =   "车牌号码"
  131.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  132.                Type            =   0
  133.                Format          =   ""
  134.                HaveTrueFalseNull=   0
  135.                FirstDayOfWeek  =   0
  136.                FirstWeekOfYear =   0
  137.                LCID            =   2052
  138.                SubFormatType   =   0
  139.             EndProperty
  140.          EndProperty
  141.          BeginProperty Column02 
  142.             DataField       =   "车辆类型"
  143.             Caption         =   "车辆类型"
  144.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  145.                Type            =   0
  146.                Format          =   ""
  147.                HaveTrueFalseNull=   0
  148.                FirstDayOfWeek  =   0
  149.                FirstWeekOfYear =   0
  150.                LCID            =   2052
  151.                SubFormatType   =   0
  152.             EndProperty
  153.          EndProperty
  154.          BeginProperty Column03 
  155.             DataField       =   "事故时间"
  156.             Caption         =   "事故时间"
  157.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  158.                Type            =   0
  159.                Format          =   ""
  160.                HaveTrueFalseNull=   0
  161.                FirstDayOfWeek  =   0
  162.                FirstWeekOfYear =   0
  163.                LCID            =   2052
  164.                SubFormatType   =   0
  165.             EndProperty
  166.          EndProperty
  167.          BeginProperty Column04 
  168.             DataField       =   "事故概要"
  169.             Caption         =   "事故概要"
  170.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  171.                Type            =   0
  172.                Format          =   ""
  173.                HaveTrueFalseNull=   0
  174.                FirstDayOfWeek  =   0
  175.                FirstWeekOfYear =   0
  176.                LCID            =   2052
  177.                SubFormatType   =   0
  178.             EndProperty
  179.          EndProperty
  180.          BeginProperty Column05 
  181.             DataField       =   "事故确认者"
  182.             Caption         =   "事故确认者"
  183.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  184.                Type            =   0
  185.                Format          =   ""
  186.                HaveTrueFalseNull=   0
  187.                FirstDayOfWeek  =   0
  188.                FirstWeekOfYear =   0
  189.                LCID            =   2052
  190.                SubFormatType   =   0
  191.             EndProperty
  192.          EndProperty
  193.          BeginProperty Column06 
  194.             DataField       =   "公司负担金"
  195.             Caption         =   "公司负担金"
  196.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  197.                Type            =   0
  198.                Format          =   ""
  199.                HaveTrueFalseNull=   0
  200.                FirstDayOfWeek  =   0
  201.                FirstWeekOfYear =   0
  202.                LCID            =   2052
  203.                SubFormatType   =   0
  204.             EndProperty
  205.          EndProperty
  206.          BeginProperty Column07 
  207.             DataField       =   "保险理赔金"
  208.             Caption         =   "保险理赔金"
  209.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  210.                Type            =   0
  211.                Format          =   ""
  212.                HaveTrueFalseNull=   0
  213.                FirstDayOfWeek  =   0
  214.                FirstWeekOfYear =   0
  215.                LCID            =   2052
  216.                SubFormatType   =   0
  217.             EndProperty
  218.          EndProperty
  219.          BeginProperty Column08 
  220.             DataField       =   "对方赔偿金"
  221.             Caption         =   "对方赔偿金"
  222.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  223.                Type            =   0
  224.                Format          =   ""
  225.                HaveTrueFalseNull=   0
  226.                FirstDayOfWeek  =   0
  227.                FirstWeekOfYear =   0
  228.                LCID            =   2052
  229.                SubFormatType   =   0
  230.             EndProperty
  231.          EndProperty
  232.          BeginProperty Column09 
  233.             DataField       =   "对方姓名"
  234.             Caption         =   "对方姓名"
  235.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  236.                Type            =   0
  237.                Format          =   ""
  238.                HaveTrueFalseNull=   0
  239.                FirstDayOfWeek  =   0
  240.                FirstWeekOfYear =   0
  241.                LCID            =   2052
  242.                SubFormatType   =   0
  243.             EndProperty
  244.          EndProperty
  245.          BeginProperty Column10 
  246.             DataField       =   "对方住址"
  247.             Caption         =   "对方住址"
  248.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  249.                Type            =   0
  250.                Format          =   ""
  251.                HaveTrueFalseNull=   0
  252.                FirstDayOfWeek  =   0
  253.                FirstWeekOfYear =   0
  254.                LCID            =   2052
  255.                SubFormatType   =   0
  256.             EndProperty
  257.          EndProperty
  258.          BeginProperty Column11 
  259.             DataField       =   "对方所在单位"
  260.             Caption         =   "对方所在单位"
  261.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  262.                Type            =   0
  263.                Format          =   ""
  264.                HaveTrueFalseNull=   0
  265.                FirstDayOfWeek  =   0
  266.                FirstWeekOfYear =   0
  267.                LCID            =   2052
  268.                SubFormatType   =   0
  269.             EndProperty
  270.          EndProperty
  271.          BeginProperty Column12 
  272.             DataField       =   "对方损坏程度"
  273.             Caption         =   "对方损坏程度"
  274.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  275.                Type            =   0
  276.                Format          =   ""
  277.                HaveTrueFalseNull=   0
  278.                FirstDayOfWeek  =   0
  279.                FirstWeekOfYear =   0
  280.                LCID            =   2052
  281.                SubFormatType   =   0
  282.             EndProperty
  283.          EndProperty
  284.          BeginProperty Column13 
  285.             DataField       =   "和解内容"
  286.             Caption         =   "和解内容"
  287.             BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  288.                Type            =   0
  289.                Format          =   ""
  290.                HaveTrueFalseNull=   0
  291.                FirstDayOfWeek  =   0
  292.                FirstWeekOfYear =   0
  293.                LCID            =   2052
  294.                SubFormatType   =   0
  295.             EndProperty
  296.          EndProperty
  297.          SplitCount      =   1
  298.          BeginProperty Split0 
  299.             BeginProperty Column00 
  300.                ColumnWidth     =   824.882
  301.             EndProperty
  302.             BeginProperty Column01 
  303.                ColumnWidth     =   854.929
  304.             EndProperty
  305.             BeginProperty Column02 
  306.                ColumnWidth     =   854.929
  307.             EndProperty
  308.             BeginProperty Column03 
  309.                ColumnWidth     =   840.189
  310.             EndProperty
  311.             BeginProperty Column04 
  312.                ColumnWidth     =   915.024
  313.             EndProperty
  314.             BeginProperty Column05 
  315.                ColumnWidth     =   1184.882
  316.             EndProperty
  317.             BeginProperty Column06 
  318.                ColumnWidth     =   1049.953
  319.             EndProperty
  320.             BeginProperty Column07 
  321.                ColumnWidth     =   1019.906
  322.             EndProperty
  323.             BeginProperty Column08 
  324.                ColumnWidth     =   1005.165
  325.             EndProperty
  326.             BeginProperty Column09 
  327.                ColumnWidth     =   824.882
  328.             EndProperty
  329.             BeginProperty Column10 
  330.                ColumnWidth     =   794.835
  331.             EndProperty
  332.             BeginProperty Column11 
  333.                ColumnWidth     =   1244.976
  334.             EndProperty
  335.             BeginProperty Column12 
  336.                ColumnWidth     =   1214.929
  337.             EndProperty
  338.             BeginProperty Column13 
  339.                ColumnWidth     =   870.236
  340.             EndProperty
  341.          EndProperty
  342.       End
  343.    End
  344.    Begin VB.Frame Frame1 
  345.       Caption         =   "  查询条件"
  346.       ForeColor       =   &H00FF0000&
  347.       Height          =   1185
  348.       Left            =   120
  349.       TabIndex        =   0
  350.       Top             =   120
  351.       Width           =   5970
  352.       Begin VB.CheckBox ckcp 
  353.          Caption         =   "车牌号码:"
  354.          Height          =   255
  355.          Left            =   120
  356.          TabIndex        =   5
  357.          Top             =   360
  358.          Width           =   1215
  359.       End
  360.       Begin VB.CheckBox cktime 
  361.          Caption         =   "事故时间:"
  362.          Height          =   180
  363.          Left            =   120
  364.          TabIndex        =   4
  365.          Top             =   750
  366.          Width           =   1215
  367.       End
  368.       Begin VB.ComboBox cmCP 
  369.          Enabled         =   0   'False
  370.          Height          =   300
  371.          Left            =   1560
  372.          TabIndex        =   3
  373.          Top             =   360
  374.          Width           =   1335
  375.       End
  376.       Begin VB.CommandButton cmdExit 
  377.          Caption         =   "退 出(&E)"
  378.          Height          =   345
  379.          Left            =   4890
  380.          TabIndex        =   2
  381.          Top             =   690
  382.          Width           =   975
  383.       End
  384.       Begin VB.CommandButton cmdCha 
  385.          Caption         =   "查 询(&F)"
  386.          Height          =   330
  387.          Left            =   4890
  388.          TabIndex        =   1
  389.          Top             =   360
  390.          Width           =   975
  391.       End
  392.       Begin MSComCtl2.DTPicker dtEnd 
  393.          Height          =   300
  394.          Left            =   3375
  395.          TabIndex        =   6
  396.          Top             =   750
  397.          Width           =   1335
  398.          _ExtentX        =   2355
  399.          _ExtentY        =   529
  400.          _Version        =   393216
  401.          Enabled         =   0   'False
  402.          Format          =   66191361
  403.          CurrentDate     =   38053
  404.       End
  405.       Begin MSComCtl2.DTPicker dtStart 
  406.          Height          =   300
  407.          Left            =   1560
  408.          TabIndex        =   7
  409.          Top             =   750
  410.          Width           =   1335
  411.          _ExtentX        =   2355
  412.          _ExtentY        =   529
  413.          _Version        =   393216
  414.          Enabled         =   0   'False
  415.          Format          =   66191361
  416.          CurrentDate     =   38053
  417.       End
  418.       Begin VB.Label Label6 
  419.          Caption         =   "从"
  420.          ForeColor       =   &H00FF0000&
  421.          Height          =   255
  422.          Left            =   1320
  423.          TabIndex        =   9
  424.          Top             =   810
  425.          Width           =   255
  426.       End
  427.       Begin VB.Label Label5 
  428.          Caption         =   "到"
  429.          ForeColor       =   &H00FF0000&
  430.          Height          =   255
  431.          Left            =   3045
  432.          TabIndex        =   8
  433.          Top             =   810
  434.          Width           =   255
  435.       End
  436.    End
  437. End
  438. Attribute VB_Name = "frmcarSGcha"
  439. Attribute VB_GlobalNameSpace = False
  440. Attribute VB_Creatable = False
  441. Attribute VB_PredeclaredId = True
  442. Attribute VB_Exposed = False
  443. Private Sub ckcp_Click()
  444.     If ckcp.Value Then
  445.         cmCP.Enabled = True
  446.     Else
  447.         cmCP.Enabled = False
  448.     End If
  449. End Sub
  450. Private Sub cktime_Click()
  451.     If cktime.Value Then
  452.         dtStart.Enabled = True
  453.         dtEnd.Enabled = True
  454.     Else
  455.         dtStart.Enabled = False
  456.         dtEnd.Enabled = False
  457.     End If
  458. End Sub
  459. Private Sub cmdCha_Click()
  460.    '点击查询按纽后首先清空车辆档案列表
  461.     Call QingKong
  462.    
  463.    '定义查询字符串
  464.     Dim sql As String
  465.    
  466.     Dim scp As String
  467.     If ckcp.Value Then
  468.         scp = "车牌号码 like '" & cmCP.Text & "%'"
  469.     Else
  470.         scp = "车牌号码 like '%'"
  471.     End If
  472.     
  473.     Dim stime As String
  474.     If cktime.Value Then
  475.         stime = "事故时间 between #" & dtStart.Month & "/" & dtStart.Day & "/" & dtStart.Year & "# and #" & dtEnd.Month & "/" & dtEnd.Day & "/" & dtEnd.Year & "#"
  476.         Else
  477.         stime = "事故时间 like '%'"
  478.     End If
  479.          
  480.     sql = "select * from 车辆事故表 where " & scp & "and " & stime
  481.     'MsgBox sql
  482.     
  483.     
  484.     If sql = "select * from 车辆事故表 where 车牌号码 like '%'and 事故时间 like '%'" Then
  485.         Call QingKong
  486.         MsgBox "请选择查询条件", , "系统提示"
  487.         Exit Sub
  488.     End If
  489.     
  490.     Set adors = adoCon.Execute(sql)
  491.     
  492.     If adors.EOF Then
  493.         Call QingKong
  494.         MsgBox "对不起,没有符合您查询条件的车辆事故记录!", , "系统提示"
  495.     Else
  496.        Adodc1.RecordSource = sql
  497.        Adodc1.Refresh
  498.     End If
  499.     
  500.     adors.Close
  501.     
  502.     ckcp.Value = 0
  503.     cktime.Value = 0
  504.     
  505. End Sub
  506. Private Sub cmdExit_Click()
  507.     MDIForm1.StatusBar1.Panels(1).Text = ""
  508.     Unload Me
  509. End Sub
  510. Private Sub Form_Load()
  511.     frmcarSGcha.Width = 6375
  512.     frmcarSGcha.Height = 3885
  513.     Call Rebind
  514.    Set adors = adoCon.Execute("select distinct 车牌号码 from 车辆事故表")
  515.    On Error Resume Next
  516.     Do
  517.         cmCP.AddItem adors.Fields(0)
  518.         adors.MoveNext
  519.     Loop Until adors.EOF
  520.     adors.Close
  521. End Sub
  522. Private Sub Rebind()
  523.     Frame2.Caption = "车辆事故列表"
  524.     Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "clgl.mdb;Persist Security Info=False"
  525.     Adodc1.RecordSource = "select * from 车辆事故表"
  526.     Adodc1.Refresh
  527. End Sub
  528. Private Sub QingKong()
  529.     Frame2.Caption = "您所要查询的车辆事故记录如下:"
  530.     Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "clgl.mdb;Persist Security Info=False"
  531.     Adodc1.RecordSource = "select * from 车辆事故表 where 0=1"
  532.     Adodc1.Refresh
  533. End Sub
  534. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  535.     cmdExit_Click
  536.     
  537. End Sub