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

📄 ucqueryr.ctl

📁 VB制作的简单的基于access的停车管理数据库
💻 CTL
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.UserControl ucquery 
   BackStyle       =   0  '透明
   ClientHeight    =   5400
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   7725
   ScaleHeight     =   5400
   ScaleWidth      =   7725
   Begin MSComctlLib.ListView ListView 
      Height          =   3975
      Left            =   240
      TabIndex        =   10
      Top             =   240
      Width           =   7215
      _ExtentX        =   12726
      _ExtentY        =   7011
      View            =   3
      Arrange         =   2
      Sorted          =   -1  'True
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      FlatScrollBar   =   -1  'True
      FullRowSelect   =   -1  'True
      GridLines       =   -1  'True
      HoverSelection  =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      NumItems        =   6
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Text            =   "停车序列号"
         Object.Width           =   2646
      EndProperty
      BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   1
         Text            =   "入场时间"
         Object.Width           =   3528
      EndProperty
      BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   2
         Text            =   "出场时间"
         Object.Width           =   3528
      EndProperty
      BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   3
         Text            =   "收费"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   4
         Text            =   "入场记录员"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   5
         Text            =   "出场记录员"
         Object.Width           =   2540
      EndProperty
   End
   Begin VB.CommandButton cmdcancel 
      Caption         =   "返回"
      Height          =   495
      Left            =   5400
      TabIndex        =   9
      Top             =   4560
      Width           =   1455
   End
   Begin VB.Frame Frame1 
      Height          =   3975
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   7215
      Begin VB.CommandButton cmdok 
         Caption         =   "确定"
         Height          =   495
         Left            =   5160
         TabIndex        =   8
         Top             =   3120
         Width           =   1455
      End
      Begin VB.TextBox txtuserquery 
         Height          =   495
         Left            =   2880
         TabIndex        =   7
         Top             =   2160
         Width           =   3495
      End
      Begin MSComCtl2.DTPicker DTPicker 
         Height          =   495
         Left            =   2880
         TabIndex        =   6
         Top             =   1440
         Width           =   3495
         _ExtentX        =   6165
         _ExtentY        =   873
         _Version        =   393216
         Format          =   25559041
         CurrentDate     =   39557
      End
      Begin VB.TextBox txtparkingno 
         Height          =   495
         Left            =   2880
         TabIndex        =   5
         Top             =   720
         Width           =   3495
      End
      Begin VB.OptionButton Option3 
         Caption         =   "按出场或入场记录员查询:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   240
         TabIndex        =   4
         Top             =   2160
         Width           =   2895
      End
      Begin VB.OptionButton Option2 
         Caption         =   "按入场时间查询:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   240
         TabIndex        =   3
         Top             =   1440
         Width           =   2055
      End
      Begin VB.OptionButton Option1 
         Caption         =   "按编号查询:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   240
         TabIndex        =   2
         Top             =   720
         Width           =   2655
      End
      Begin VB.Label Label1 
         Alignment       =   2  'Center
         Caption         =   "出入车辆查询"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2160
         TabIndex        =   1
         Top             =   240
         Width           =   2895
      End
   End
End
Attribute VB_Name = "ucquery"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Private Sub cmdcancel_Click()
Frame1.Visible = True
ListView.Visible = False
End Sub

Private Sub cmdok_Click()
Dim pkno As String
Dim dbstr As String
Dim parkquery As New ADODB.Recordset
Dim querydate1 As Date
Dim querydate2 As Date
Dim opeid As String
Dim ltitm As ListItem

If Option1.Value = False And Option2.Value = False And Option3.Value = False Then
   MsgBox "请选择一个查询条件!", , "提示"
   Exit Sub
End If
If Option1.Value = True Then
   If txtparkingno.Text = "" Then
      MsgBox "请输入要查询的车辆的12位编号!", , "提示"
      Exit Sub
   ElseIf Len(Trim(txtparkingno.Text)) > 12 Then
      MsgBox "车辆编号不得大于12位!", , "提示"
      Exit Sub
   End If
   pkno = Replace(Trim(txtparkingno.Text), "'", "'")
   dbstr = "select * from parkinginfo where parkingno='"
   dbstr = dbstr & pkno & "'"
   parkquery.Open dbstr, dbcnn, adOpenStatic, adLockOptimistic
   ElseIf Option2 = True Then
      querydate1 = Format(DTPicker, "yyyy-mm-dd")
      querydate2 = DateAdd("d", 1, querydate1)
      dbstr = "select * from parkinginfo where entertime>#"
      dbstr = dbstr & querydate1
      dbstr = dbstr & "# and entertime <#"
      dbstr = dbstr & querydate2 & "#"
      parkquery.Open dbstr, dbcnn, adOpenStatic, adLockOptimistic
    ElseIf Option3 = True Then
      If txtuserquery.Text = "" Then
         MsgBox "请输入要查找的操作员的ID号!", , "提示"
         Exit Sub
      ElseIf Len(Trim(txtuserquery.Text)) > 16 Then
         MsgBox "操作员ID不能大于16位!", , "提示"
         Exit Sub
      End If
      opeid = Replace(Trim(txtuserquery.Text), "'", "'")
      dbstr = "select * from parkinginfo where parkingrecid='"
      dbstr = dbstr & opeid & "'"
      dbstr = dbstr & " or chargerecid='"
      dbstr = dbstr & "'"
      parkquery.Open dbstr, dbcnn, adOpenStatic, adLockOptimistic
End If
If parkquery.EOF Then
   MsgBox "数据库中没有符合要求的记录!", , "提示"
   Exit Sub
End If
   ListView.ListItems.Clear
   parkquery.MoveFirst
   For i = 1 To parkquery.RecordCount
       Set ltitm = ListView.ListItems.Add
           ltitm.Text = parkquery.Fields("parkingno").Value
           ltitm.SubItems(1) = parkquery.Fields("entertime").Value
           If parkquery.Fields("exittime").Value <> "" Then
              ltitm.SubItems(2) = parkquery.Fields("exittime").Value
           End If
           ltitm.SubItems(3) = parkquery.Fields("charge").Value
           ltitm.SubItems(4) = parkquery.Fields("parkingrecid").Value
           If parkquery.Fields("chargerecid") <> "" Then
              ltitm.SubItems(5) = parkquery.Fields("chargerecid").Value
           End If
        parkquery.MoveNext
   Next i
   parkquery.Close
   ListView.Visible = True
   Frame1.Visible = False
   addrec (2)
      
End Sub

Private Sub UserControl_Initialize()
Frame1.Visible = True
ListView.Visible = False
txtparkingno.Text = ""
txtuserquery.Text = ""

End Sub

⌨️ 快捷键说明

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