>I am using VB 6.0 and I created a class with several functions. One of them creates a recordset with the code below:
>
>set rsObj = New ADODB.Recordset
>rsObj.ActiveConnection = oConn
>rsObj.Open strQuery
>
>I would like to store rsObj in a property so that I don't have to query again. I, then, created a property with the code below:
>
>Public Property Get oRecSet() As ADODB.Recordset
> oRecSet = mrsResults
>End Property
>
>I would like to store oRecSet with rsObj so I can use it with other functions. However, my code keeps blowing up with this property definition. Can a class have a property that is a recordset? And, if so, am I creating the property correctly?
>
Try this:
Public Property Get oRecSet() As Recordset
Set oRecSet = rsObj
End Property
(Of course rsObj must be a module level variable)
George