PDA

Click to See Complete Forum and Search --> : SQL STORED PROCEDURES


oberon
Nov 13th, 2000, 11:18 AM
I am using the ADODB command object to run stored procedures in an SQL Database

The procedure runs ok, i know this because i can see the data changing....However the command object is giving a null value for the return parameter...I need this parameter to pass into another stored procedure ....

has anyone seen this problem before and if so did they find a fix?

heres my statements.

Set objcmd = New ADODB.Command
Set objcmd.ActiveConnection = objconn

'Insert parameters into the stored proceure
objconn.CursorLocation = adUseClient

objcmd.CommandText = "dbo.spa_PackingSlipCreate"
objcmd.CommandType = adCmdStoredProc
objcmd.Parameters.Append objcmd.CreateParameter("RC", adInteger, adParamReturnValue)
objcmd.Parameters.Append objcmd.CreateParameter("OrderNo", adVarChar, adParamInput, 30, "000619-24052")
objcmd.Parameters.Append objcmd.CreateParameter("PackSlipNo", adVarChar, adParamOutput, 30)
objcmd.Execute

'feedback
MsgBox objcmd.Parameters.Item("RC")
MsgBox objcmd.Parameters.Item("OrderNo")
MsgBox objcmd.Parameters.Item("PackSlipNo")



the output parameter is NULL all the time


Please help

Regards
A frustrated programmer

Bigley
Nov 14th, 2000, 04:27 PM
Never tried doing it like that before but it looks to be ok.... what happens when you run the SP in the query analyser window?