[thelist] capturing returned value from MS-SQL stored procedure

Anthony Baratta Anthony at Baratta.com
Thu Jan 10 17:57:17 CST 2002


At 03:42 PM 1/10/2002, spinhead wrote:
>=======================
>   strQuery = "DECLARE @PonID int EXECUTE sp_pon_Add " & strPoID & ", @RetVal
>= @PonID OUTPUT"
>   Set AddPON = objConn.Execute(strQuery)
>=======================
>
>So now, how do I get the value of @PonID into a VBScript variable?

Try this on the next line...

         varPonID = AddPON(0)
         AddPON.Close

The way I'm reading your code, AddPON is your "Record Set Collection" and 
needs to be "iterated through" to get your data. In this case you are only 
returning one value, with no name. So you use AddPON(0) to get the value 
being returned.


----
Anthony Baratta
President
Keyboard Jockeys

"Conformity is the refuge of the unimaginative."





More information about the thelist mailing list