View Single Post
  #1 (permalink)  
Old April 17th, 2007, 02:06 PM
gscott gscott is offline
Registered User
Join Date: Apr 2007
Location: Crystal Lake, IL, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default DTS and ActiveX VB Script

Hi Everyone -
I am having a little problem and I think I can thank Microsoft for it. I am trying to create a DTS package that runs a select statement that is a count of rounds and based on the count I want to run one set of code or another set of code.
How would you go about this?
What I have tried is a SQL statement with a global variable and then I am trying to reference the global variable in an activex script task - and the task is failing -
Task code is:

' Visual Basic ActiveX Script
Function Main()
    dim sql
    set sql = DTSGlobalVariables("CountofRec").Value
    If sql > 700 Then <--I get a type mismatch on this line
    Main = DTSTaskExecResult_Success
    Main = DTSTaskExecResult_Failure
    End If
End Function

What is wrong with this? Please help! As I would so grateful for it:)