Re: Testing Global Output Variable Value

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Robert Richards via SQLMonster.com (forum_at_SQLMonster.com)
Date: 01/17/05


Date: Mon, 17 Jan 2005 17:59:52 GMT

I am still getting the same error. This is what I have verbatim for my script:

Function Main()
        Dim resp

        resp = MsgBox("The row count in table IFSMessages is: " & DTSGlobalVariables("gMsgCount").Value, VBYesNo)
        
if resp = VBYes then
                'execute package
        else
                'do not execute package
        end if
        Main = DTSTaskExecResult_Success
End Function

When I execute the ActiveX object step I get a VBScript error saying "Variable uses an automation type not supported in VBScript."

Within the ActiveX Script Task properties, Package Object Browser under Global Variables I am able to see the output variable "gMsgBox" that I created in Execute SQL Task.

Within Execute SQL Task my SQL Statement verbatim is:
select count(*) as msgcount from ifsmessages

When I select the Parameters button and then the Output parameters tab, I have Row value output parameter type option selected. Below that I have in Parameter Mapping a parameter of "msgcount" and Output Global Variables as "gMsgCount".

Any idea why I am getting the above error? If I remove the reference to DTSGlobalVariables("gMsgCount").Value in the MsgBox statement the script executes without the error, but obviously I do not get a count because the global variable is not being referenced.

-- 
Message posted via http://www.sqlmonster.com


Relevant Pages

  • Re: [opensuse] alias failure
    ... verbatim in front of any arguments you give, so if you invoke it ... I put that in a script, and got 'cat: drives: No such file or ... "All scripture is God-breathed and is useful for teaching, ...
    (SuSE)
  • Re: output
    ... Vyas, MVP (SQL Server) ... > The main problem i have is in Execute SQL Task, ... > that's why I asked if it should be done in Active X Script... ... I created a stored procedure that returns a value after execution ...
    (microsoft.public.sqlserver.dts)
  • Re: Create package in place of script
    ... > Start a new package and include the script into Execute SQL task. ... I could drop the script into an execute sql task, ... Aaron ...
    (microsoft.public.sqlserver.dts)
  • RE: output
    ... The main problem i have is in Execute SQL Task, ... Exec ProcedureName @output output ... that's why I asked if it should be done in Active X Script... ... > how am i able to get the output value from the stored procedure using DTS, ...
    (microsoft.public.sqlserver.dts)
  • Re: ortho map projection problem
    ... Matlab...I'm copying examples verbatim, but am getting error messages that I can't find help for. ... Here's my script: ... "No shapes were given as input!" ...
    (comp.soft-sys.matlab)