Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Definite newbie here..can I have a recordset property?
Message
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00404087
Message ID:
00404251
Views:
12
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform