
VB4 RDO Won't detect an error in an SQL Server 6.0 stored procedure
Hi
I'm having trouble getting an RDO to return an error from an SQL Server
stored procedure.
Has anyone got his to work for anything other than a trivial stored
procedure (one select only).??
The code below NEVER detects an error!
Code looks like this:
'Call stored procedure PROC_XX. It has 3 parameters. Expect a return value
in parameter(0)
sStoredProcName = "PROC_XX"
Set psStmt = UPDB.CreatePreparedStatement(sStoredProcName, "{?=Call
PROC_XX(?,?,?)}")
With UPDB.rdoPreparedStatements(sStoredProcName)
.rdoParameters(0).Direction = rdParamReturnValue
.rdoParameters(1) = "CUP"
.rdoParameters(2) = SQLDate(pEffDate)
.rdoParameters(3) = SQLDate(pCalibreDate)
.QueryTimeout = 60
'Have removed the execution asynchronously method from next statemnet
because we don't
'want to continue until stored procedure is complete.
.Execute
If UPDB.rdoPreparedStatements(sStoredProcName).rdoParameters(0)
<> 0 Then
MsgBox "Error in Your stored procedure mate!"
Exit Sub
End If
James