Share via


Visual Basic: RDO Data Control

SQL Property Example

For example, to execute a procedure that accepts two input parameters and returns a return value and an output parameter, you can use the following code. The example creates an rdoQuery object whose SQL property is set to the string specified by QSQL$. This query calls a stored procedure that returns a return status, and an output argument as well as accepting two input arguments.

  Dim Cqy as new rdoQuery
Dim MyRs as rdoResultset
Cqy.SQL = "{ ? = call sp_MyProc (?, ?, ?) }"
Cqy(0).Direction = rdReturnValue
Cqy(1).Direction = rdParamInput
Cqy(2).Direction = rdParamInput
Cqy(3).Direction = rdParamOutput
Cqy(1) = "Victoria"
Cqy(0) = 21
Set MyRs = Cqy.OpenResultSet(rdOpenForwardOnly)