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

📄 selectdriver_frm.frm

📁 车次查询-输入要查询的车次既可查询车次所有的停靠站 站点查询-输入一个站点
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form selectdriver_frm 
   BackColor       =   &H00400000&
   Caption         =   "查询市民对司机发表的意见"
   ClientHeight    =   4665
   ClientLeft      =   7035
   ClientTop       =   3825
   ClientWidth     =   4260
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   4665
   ScaleWidth      =   4260
   Begin MSAdodcLib.Adodc Ado 
      Height          =   330
      Left            =   1680
      Top             =   1800
      Visible         =   0   'False
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   ""
      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 VB.Frame Frame1 
      BackColor       =   &H00FFC0C0&
      Caption         =   "查询"
      Height          =   1695
      Left            =   0
      TabIndex        =   1
      Top             =   3000
      Width           =   4335
      Begin VB.CommandButton cmdexit 
         Caption         =   "退出查询"
         Height          =   375
         Left            =   2280
         TabIndex        =   5
         Top             =   960
         Width           =   1455
      End
      Begin VB.CommandButton cmdinquire 
         Caption         =   "查询"
         Height          =   375
         Left            =   360
         TabIndex        =   4
         Top             =   960
         Width           =   1455
      End
      Begin VB.ComboBox Combo1 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         Left            =   2280
         TabIndex        =   2
         Top             =   360
         Width           =   1455
      End
      Begin VB.Image Image1 
         Height          =   240
         Left            =   360
         Picture         =   "selectdriver_frm.frx":0000
         Top             =   360
         Width           =   240
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "选择姓名"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   720
         TabIndex        =   3
         Top             =   360
         Width           =   1095
      End
   End
   Begin MSFlexGridLib.MSFlexGrid myFlexgrid 
      Height          =   3015
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   4335
      _ExtentX        =   7646
      _ExtentY        =   5318
      _Version        =   393216
      Rows            =   3
      Cols            =   4
      BackColorBkg    =   128
   End
End
Attribute VB_Name = "selectdriver_frm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub cmdexit_Click()
  Unload Me
End Sub

Private Sub cmdinquire_Click()
   '看是否选择司机姓名
   If Combo1.Text = "" Then
        MsgBox "请你选择司机姓名!", vbOKOnly + vbExclamation, "提示"
        Exit Sub
    End If
    On Error Resume Next
    Ado.Recordset.Close
    Ado.Recordset.Open "select * from drivercomment_result where driver_name='" + Combo1.Text + " '"
    '看所输入的车号是否存在
    If Ado.Recordset.EOF Then
        MsgBox "你所输入的司机姓名还没登记"
    Else
        '利用控件 MSFlexGrid来显示查询结果
       With myFlexgrid
       .Rows = 3
       .CellAlignment = 2
       .TextMatrix(1, 0) = "司机姓名"
       .TextMatrix(1, 1) = "第一道结果"
       .TextMatrix(1, 2) = "第二道结果"
       .TextMatrix(1, 3) = "第三道结果"
        
      Do While Not Ado.Recordset.EOF
       .Rows = .Rows + 1
       .CellAlignment = 2
       '看记录集中该列的数据是否是空的
       If IsNull(Ado.Recordset.Fields(0)) Then
         .TextMatrix(.Rows - 1, 0) = ""
        Else
         .TextMatrix(.Rows - 1, 0) = Ado.Recordset.Fields(0)
       End If
       '看记录集中的数据是否是空的
       If IsNull(Ado.Recordset.Fields(1)) Then
        .TextMatrix(.Rows - 1, 1) = "  "
       Else
        .TextMatrix(.Rows - 1, 1) = Ado.Recordset.Fields(1)
       End If
       '看记录集中的数据是否是空的
       If IsNull(Ado.Recordset.Fields(2)) Then
          .TextMatrix(.Rows - 1, 2) = ""
        Else
          .TextMatrix(.Rows - 1, 2) = Ado.Recordset.Fields(2)
       End If
       '看记录集中的数据是否是空的
       If IsNull(Ado.Recordset.Fields(3)) Then
         .TextMatrix(.Rows - 1, 3) = ""
        Else
         .TextMatrix(.Rows - 1, 3) = Ado.Recordset.Fields(3)
        End If
        '看记录集中的数据是否是空的
       Ado.Recordset.MoveNext
      Loop
    End With
  End If
  
End Sub

Private Sub Form_Load()
   Dim a As Integer
   '采用ADO控件来连接数据库中的drivercomment_result中显示唯一的姓名
   Ado.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\db1.mdb"
   Ado.CommandType = adCmdText
   Ado.RecordSource = "select distinct driver_name  from drivercomment_result"
   Ado.Refresh
   
  For a = 0 To Ado.Recordset.RecordCount - 1
    Combo1.AddItem Ado.Recordset.Fields(0)
   
    If Ado.Recordset.EOF = False Then
       Ado.Recordset.MoveNext
    End If
  Next
 End Sub



⌨️ 快捷键说明

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