Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What did I do wrong here ???
Message
 
To
08/03/2000 17:31:49
General information
Forum:
Visual Basic
Category:
ActiveX controls
Miscellaneous
Thread ID:
00343476
Message ID:
00343535
Views:
18
>The following code generates an "Improper use of parameter" error on the indicated line ... What did I do wrong ???
>
>Private Sub Form_Load()
>
> Dim loCustList As New ADODB.Recordset
> loCustList = GetCustList <<< Error Generated >>>
>
>End Sub
>
>
>Private Function GetCustList()
>
> Dim loCn As New ADODB.Connection
> Dim loCm As New ADODB.Command
>
> loCm.CommandText = "SELECT customer_id, customername FROM EffDscRpt..Customers ORDER BY customer_id"
> loCn.Open "dsn=ibcntdmsql;uid=sa;pwd=titan29"
> loCm.ActiveConnection = loCn
>
> GetCustList = loCm.Execute
>
>End Function
>
>Assistance greatly appreciated ...
>
>Regards,
>
>Jason

Since your function returns a recordset (which is an object), you have to use the Set operator to assign the object returned from your function to your variable:
Set loCustList = GetCustList
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform