General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>Thanks J:
>
>As usual, you are always very helpful.
>Question: How do you set/send parameters for RecordSet.Open? Is it like the Command Object?
>
>With a Command Object it's ...
>Dimension aparam[1]
>aparam[1] = "send me"
>oRecordSet = oCommand.Execute(...,@aparam,...,...)
>
>What would the code look to ESTABLISH the parameter and then SEND the parameter using RecordSet.Open(...)?
>
>Again, TIA
>
>>>Hello:
>>>
>>>Is there a way to pass parameters to a stored procedure, in SQL SERVER
>>>7.0, via the ADO RecordSet Object instead of the ADO Command Object?
>>>
>>>Reason: Need a RecordSet that's not READONLY.
>>>
>>>TIA
>>
>>Yes, but you still use a command object. Just replace the line where you use the command.Execute with the recordset.Open and pass the command object as the source. Specify the needed parameters in the rest of the RS's parameters.
Malcolm,
To use a stored procedure that requires parameters, you need to define a command object. What I meant by the recordset's parameters is the ones where you specify the type of cursor you want to open, as in recordset.Open(Source, ActiveConnection, CursorType, LockType, Options).
The trick is to create the command object with the required parameters and then pass it as the Source of the recordset.Open.
And thanks for the kind words!
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only