Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADO Recordset as a Parameter
Message
De
15/09/1999 12:36:17
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
ADO Recordset as a Parameter
Divers
Thread ID:
00265053
Message ID:
00265053
Vues:
43
Maybe this is an easy question. I hope I'm just not pulling a no-brainer here...

I'm writing a COM Object to help compile item information from many different, related tables in a database. I want to pass in a blank ADO Recordset object into a FUNCTION, and within the function, populate that recordset.

My FUNCTION definition is:

--------Snip--------

Public Function GetCategory(ByVal Catalog As String, _
ByRef rsCategory As ADODB.Recordset) As Boolean

--------Snip--------

The routine that I use to call this function is:

--------Snip--------

Private Sub cmdGetCategory_Click()

Dim objCategory As ECommerce.GetItem
Dim rstCategory As ADODB.Recordset
Dim blnReturn As Boolean

blnReturn = objCategory.GetCategory( _
Trim(txtCatalog.Text), rstCategory)

If blnReturn Then
dbgRecordset.DataSource = rstCategory
dbgRecordset.Refresh
End If

End Sub

--------Snip--------

Of course, I get an "Object Variable or With block variable not set." error when I run this because the "rstCategory" is equal to Nothing. How can I pass in a blank ADO Recordset object, or is this not possible?

Thanks.

-Joe
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform