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

📄 select2.frm

📁 VB6数据库开发指南》的配套源程序
💻 FRM
字号:
VERSION 5.00
Object = "{FAEEE763-117E-101B-8933-08002B2F4F5A}#1.1#0"; "DBLIST32.OCX"
Begin VB.Form Form1 
   BackColor       =   &H00C0C0C0&
   Caption         =   "Chapter 3.2 Example"
   ClientHeight    =   2640
   ClientLeft      =   1080
   ClientTop       =   2460
   ClientWidth     =   3555
   LinkTopic       =   "Form1"
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   2640
   ScaleWidth      =   3555
   Begin VB.CommandButton cmdClose 
      Caption         =   "&Close Form"
      Height          =   465
      Left            =   1440
      TabIndex        =   3
      Top             =   1650
      Width           =   1995
   End
   Begin VB.CommandButton cmdShowUnique 
      Caption         =   "Show &Unique"
      Height          =   465
      Left            =   1440
      TabIndex        =   2
      Top             =   900
      Width           =   1995
   End
   Begin VB.CommandButton cmdShowAll 
      Caption         =   "Show &All"
      Height          =   465
      Left            =   1440
      TabIndex        =   1
      Top             =   120
      Width           =   1995
   End
   Begin VB.Data dtaData 
      Caption         =   "dtaData"
      Connect         =   "Access"
      DatabaseName    =   ""
      DefaultCursorType=   0  'DefaultCursor
      DefaultType     =   2  'UseODBC
      Exclusive       =   0   'False
      Height          =   345
      Left            =   90
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   2  'Snapshot
      RecordSource    =   ""
      Top             =   2220
      Visible         =   0   'False
      Width           =   1230
   End
   Begin MSDBCtls.DBList dlstData 
      Bindings        =   "Select2.frx":0000
      Height          =   2010
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   1185
      _ExtentX        =   2090
      _ExtentY        =   3545
      _Version        =   327680
      BackColor       =   -2147483643
      ListField       =   "State"
      BoundColumn     =   ""
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

'Insure that the following points to your copy of BIBLIO.MDB.
Private Const BIBLIO_PATH = "D:\Program Files\Microsoft Visual Studio\VB6\Biblio.MDB"

Private Sub cmdClose_Click()
    End
End Sub

Private Sub cmdShowAll_Click()
    Dim strSQL As String
    
    'Perform the simple SELECT query.  Note the lack of the
    'DISTINCT keyword (see the cmdShowUnique_Click event
    'for more info.)
    strSQL = "SELECT [State] FROM [Publishers] " & _
        "WHERE [State] IS NOT NULL " & _
        "ORDER BY [State]"
        
    'Set the RecordSource and refresh the data control & DBList control
    RefreshControls strSQL
End Sub

Private Sub cmdShowUnique_Click()
    Dim strSQL As String
    
    'Perform the SELECT DISTINCT query.  Since the DISTINCT keyword is
    'present, only the first instance of a given [State] value is
    'represented in the result set.
    strSQL = "SELECT DISTINCT [State] FROM [Publishers] " & _
        "WHERE [State] IS NOT NULL " & _
        "ORDER BY [State]"
    
    'Set the RecordSource and refresh the data control & DBList control
    RefreshControls strSQL
End Sub
Private Sub RefreshControls(strSQL As String)
    dtaData.RecordSource = strSQL
    dtaData.Refresh
    dlstData.Refresh
End Sub

Private Sub Form_Load()
    'Set the DatabaseName from the BIBLIO_PATH constant.
    dtaData.DatabaseName = BIBLIO_PATH
End Sub

⌨️ 快捷键说明

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