dbTalk Databases Forums  

DTS ActiveXScript Proc Return Value

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS ActiveXScript Proc Return Value in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
JDP@Work
 
Posts: n/a

Default DTS ActiveXScript Proc Return Value - 05-18-2004 , 07:14 PM






I have a proc that runs quite fine from the QA.

I've added the feature that at the end..

Return(@num)

Where @num is the number of records that could be processed

Here is my AXS snipet....

line 9
..Parameters.Append .CreateParameter("Return_Value", 3, 4)
..Execute
Cnn.close
MsgBox "Return: " & cstr(.Parameters("Return_Value").Value)
End With
End Sub

Error on Line 10 too many parameters!

In TSQL...

exec @res = usp_cal_cleanup @num

select @res

This works fine, What's Up with ADO?

TIA

JeffP.....



Reply With Quote
  #2  
Old   
Nigel Rivett
 
Posts: n/a

Default Re: DTS ActiveXScript Proc Return Value - 05-19-2004 , 04:47 AM






Why not use an output parameter rather than return value - that's
usually used for error codes.

Nigel Rivett
www.nigelrivett.net

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #3  
Old   
JDP@Work
 
Posts: n/a

Default Re: DTS ActiveXScript Proc Return Value - 05-19-2004 , 09:07 AM



Thanks but I finally found a similar situation doing a Google.....

....which susggested adding the Return_Value prior to any other params.

line 6
.Parameters.Append .CreateParameter("Return_Value", 3, 4)
.Parameters.Append .CreateParameter("@num", 3, 1, 0, cNum)
.Execute
Cnn.Close
End With

End Sub

The rule appears to be to add the Return value first.

I'm thinking that either or both of two cases may apply:

1. It's ordinal param position is 1
2. It is automatically added by ADO and specifying it twice throws the error of
too many params....

I had always passed my params by Name not by position.

I guess that all those using Refresh were overcoming this issue, but what a
waste of resources, it's so much easier to find the right solution rather than
calling refresh.

It's as if one is saying compile me again, compile me again.....

HTH

JeffP......



"JDP@Work" <JPGMTNoSpam (AT) sbcglobal (DOT) net> wrote

Quote:
I have a proc that runs quite fine from the QA.

I've added the feature that at the end..

Return(@num)

Where @num is the number of records that could be processed

Here is my AXS snipet....

line 9
.Parameters.Append .CreateParameter("Return_Value", 3, 4)
.Execute
Cnn.close
MsgBox "Return: " & cstr(.Parameters("Return_Value").Value)
End With
End Sub

Error on Line 10 too many parameters!

In TSQL...

exec @res = usp_cal_cleanup @num

select @res

This works fine, What's Up with ADO?

TIA

JeffP.....






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.