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

📄 clsprintdata.cls

📁 远程访问sql server 的源码
💻 CLS
字号:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsPrintData"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Option Explicit
'定义一个frmPrintData表单的实例对象
Dim frmPrint As New frmPrintData

'local variable(s) to hold property value(s)

'定义一个记录集对象类型的属性变量,用来接受外部传递的源记录集
Private mvarrsSource As ADODB.Recordset  'local copy
'定义接收外部传入的链接对象的属性变量
Private mvarcnnConnection As ADODB.Connection 'local copy

'定义公有方法,用从外部传入的数据来设置类的属性
Public Sub InitDB(ByVal temConn As ADODB.Connection, ByVal temRs As ADODB.Recordset)
    Set cnnConnection = temConn
    Set rsSource = temRs
End Sub

'显示打印设置窗体
Public Sub ShowPrintForm()
    '传递记录集以及链接
    Set frmPrint.rsFrmSource = rsSource
    Set frmPrint.cnnFrmConnect = cnnConnection
    '显示窗体
    frmPrint.Show vbModal
    
    '***********************************************
    '用模态方式显示表单,可以更方便的与用户进行交互,减少出错
    '***********************************************
End Sub

Public Property Set cnnConnection(ByVal vData As ADODB.Connection)
'used when assigning an Object to the property, on the left side of a Set statement.
'Syntax: Set x.cnnConnection = Form1
    Set mvarcnnConnection = vData
End Property


Public Property Get cnnConnection() As ADODB.Connection
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.cnnConnection
    Set cnnConnection = mvarcnnConnection
End Property



Public Property Set rsSource(ByVal vData As ADODB.Recordset)
'used when assigning an Object to the property, on the left side of a Set statement.
'Syntax: Set x.rsSource = Form1
    Set mvarrsSource = vData
End Property


Public Property Get rsSource() As ADODB.Recordset
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.rsSource
    Set rsSource = mvarrsSource
End Property



⌨️ 快捷键说明

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