Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Definite newbie here..can I have a recordset property?
Message
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00404087
Message ID:
00404251
Vues:
13
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform