[thelist] returning output from MSSQL to vbscript

Tab Alleman talleman at Lumpsum.com
Tue Apr 18 14:15:22 CDT 2006


When you use an OUTPUT parameter like that, I think you have to get the value by reading the value of the parameter, post-execution, rather than getting it from a recordset as though you had done a SELECT.

> -----Original Message-----
> From: thelist-bounces at lists.evolt.org
> [mailto:thelist-bounces at lists.evolt.org]On Behalf Of Canfield, Joel
> Sent: Tuesday, April 18, 2006 2:46 PM
> To: thelist at lists.evolt.org
> Subject: [thelist] returning output from MSSQL to vbscript
> 
> 
> Is it obvious to anyone why this
> 
>   strQuery = strDeclarations & "EXEC @RC = spAddTask '(" & 
> strColumns &
> ")', '" & strValues & "', @WorkOrderNumber OUTPUT"
>   Set NewWorkOrder = cnxW.Execute(strQuery)
>   intNewWO_NUM = NewWorkOrder("@WorkOrderNumber")
> 
> returns the error "Item cannot be found in the collection 
> corresponding
> to the requested name or ordinal."
> 
> (using intNewWO_NUM = NewWorkOrder("WorkOrderNumber") returns the same
> error)
> 
> the stored procedure sets nocount on. the sp itself works fine; been
> using it for a couple years. I'm just trying to grab the value that
> should be returned as output in order to replace the 
> embarassingly hacky
> kludge I've always used.
> 
> thanks much
> 
> spinhead
> -- 
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester 
> and archives of thelist go to: http://lists.evolt.org 
> Workers of the Web, evolt ! 
> 



More information about the thelist mailing list