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

📄 ht207.frm

📁 《VB6数据库开发指南》所有的例程的源码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BackColor       =   &H00C0C0C0&
   Caption         =   "Record Counts"
   ClientHeight    =   3630
   ClientLeft      =   1230
   ClientTop       =   2520
   ClientWidth     =   6015
   BeginProperty Font 
      Name            =   "MS Sans Serif"
      Size            =   8.25
      Charset         =   0
      Weight          =   700
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   3630
   ScaleWidth      =   6015
   Begin VB.CommandButton cmdExit 
      Cancel          =   -1  'True
      Caption         =   "Exit"
      Default         =   -1  'True
      Height          =   615
      Left            =   2160
      TabIndex        =   3
      Top             =   2790
      Width           =   1455
   End
   Begin VB.Label lblDynasetMoved 
      Alignment       =   2  'Center
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   4860
      TabIndex        =   6
      Top             =   1710
      Width           =   885
   End
   Begin VB.Label lblDynasetCreate 
      Alignment       =   2  'Center
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   4860
      TabIndex        =   5
      Top             =   900
      Width           =   885
   End
   Begin VB.Label lblTable 
      Alignment       =   2  'Center
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   4860
      TabIndex        =   4
      Top             =   180
      Width           =   885
   End
   Begin VB.Label Label3 
      BackColor       =   &H00C0C0C0&
      Caption         =   "Records in the BIBLIO.MDB SELECT Au_ID FROM Authors dynaset after using the MoveLast method."
      Height          =   675
      Left            =   360
      TabIndex        =   2
      Top             =   1710
      Width           =   4305
   End
   Begin VB.Label Label2 
      BackColor       =   &H00C0C0C0&
      Caption         =   "Records in the BIBLIO.MDB SELECT Au_ID FROM Authors dynaset immediately after creation."
      Height          =   615
      Left            =   360
      TabIndex        =   1
      Top             =   900
      Width           =   4275
   End
   Begin VB.Label Label1 
      BackColor       =   &H00C0C0C0&
      Caption         =   "Records reported in the BIBLIO.MDB Authors table recordset:"
      Height          =   525
      Left            =   360
      TabIndex        =   0
      Top             =   180
      Width           =   4245
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Form_Load()
On Error GoTo ProcError

    Dim strDBName As String
    Dim strSQL As String
    Dim db As Database
    Dim rsTable As Recordset
    Dim rsDynaset As Recordset
    
    ' Get the database name and open the database.
    ' BiblioPath is a function in READINI.BAS
    strDBName = BiblioPath()
    
    Set db = DBEngine.Workspaces(0).OpenDatabase(strDBName)
    Set rsTable = db.OpenRecordset("Authors", dbOpenTable)
    lblTable = rsTable.RecordCount
    
    strSQL = "SELECT Au_ID FROM Authors"
    Set rsDynaset = db.OpenRecordset(strSQL, dbOpenDynaset)
    lblDynasetCreate = rsDynaset.RecordCount
    rsDynaset.MoveLast
    lblDynasetMoved = rsDynaset.RecordCount

ProcExit:
    On Error Resume Next
    ' clean up
    rsDynaset.Close
    rsTable.Close
    db.Close
    Exit Sub

ProcError:
    MsgBox Err.Description
    Resume ProcExit
    
End Sub

Private Sub cmdExit_Click()
    Unload Me
End Sub

⌨️ 快捷键说明

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