请高手帮我用vb写一个Property Set过程和一个Property get过程,以便理解Property Set的使用.
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/14 11:44:54
请高手帮我用vb写一个Property Set过程和一个Property get过程,以便理解Property Set的使用.
请高手帮我用vb写一个Property Set过程和一个Property get过程,以便理解Property Set的使用.
请高手帮我用vb写一个Property Set过程和一个Property get过程,以便理解Property Set的使用.
Dim mvarWriteLogs As Boolean
Private mvardbConObj As ADODB.Connection '局部复制
Public Property Let WriteLogs(ByRef vData As Boolean)
mvarWriteLogs = vData
End Property
Public Property Get WriteLogs() As Boolean
WriteLogs = mvarWriteLogs
End Property
Private Sub Class_Initialize() 'set对象需要初始化
Set mvardbConObj = New ADODB.Connection
set dbConObj= New ADODB.Connection
End Sub
Public Property Set dbConObj(ByRef vData As ADODB.Connection)
Set mvardbConObj = vData
End Property
Public Property Get dbConObj() As ADODB.Connection
Set dbConObj = mvardbConObj
End Property