Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What did I do wrong here ???
Message
From
09/03/2000 09:32:56
 
General information
Forum:
Visual Basic
Category:
ActiveX controls
Miscellaneous
Thread ID:
00343476
Message ID:
00343641
Views:
23
>>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

Thanks, I actually found that answer after I posted this yesterday. But another question comes up. Now, it loads up, creates the recordset quite happily, but I get a "Recordset is not bookmarkable" error when I attempt to bind this recordset to a DataGrid. I could do this part of it with an ADODC, but I have this thing about doing things the same way within a system. (Call me quirky) Since I need to fetch a parameter value from this recordset to provide to another command object I want to do them the same way.

Thanks again for your assistance.

Regards,

J.
Jason Tryon
Senior Systems Analyst / Technical Lead
eBusiness / iPage
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform