Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is wrong with this script

Status
Not open for further replies.

washaw

Programmer
Feb 13, 2008
48
0
0
Can any body tell me what is wrong with this script

I spent the whole day to figure it out

error

Error Description: Procedure 'PROC_CHECK_ARCHIVED_DATA' expects parameter '@numDate', which was not supplied.


Code:
'**********************************************************************
'  Visual Basic ActiveX Script
'************************************************************************

Function Main()

   Dim stpContinuePkg
   Dim stpExitPkg
   Dim varNumber
   

   Set pkg = DTSGlobalVariables.Parent
   varNumber = DTSGlobalVariables("numDays").Value

   SET stpContinuePkg = pkg.Steps("DTSStep_DTSExecuteSQLTask_5")
   SET stpExitPkg = pkg.Steps("DTSStep_DTSActiveScriptTask_2")

   Set objCommand = CreateObject("ADODB.Command")
   Set objParam = CreateObject("ADODB.Parameter")
   Set rsYourRecordSet = CreateObject("ADODB.Recordset")
 
   ' set the connection properties to point to the

   objCommand.ActiveConnection = "provider=SQLOLEDB.1;data source=myServer;database=myDatabase;Integrated Security=SSPI;"
   objCommand.CommandTimeout = 300

   objCommand.commandtext = "PROC_CHECK_ARCHIVED_DATA" 
   objCommand.CommandType = 4 
   Set objParm =  objCommand.CreateParameter("@numDate", 3,1, 4,varNumber) 
   objCommand.Parameters.Append objParm      
   Set objParm =  objCommand.CreateParameter("@retVal",3,2,4)
    objCommand.Parameters.Append objParm 

   objCommand("@numDate") = varNumber

   set rsYourRecordSet = objCommand.Execute

   'to access the output, assign to a variable'

       intSprocValue = objCommand.Parameters("@retVal").value


   if intSprocValue = 0 then
      stpContinuePkg.DisableStep = True
      stpExitPkg.DisableStep = False
   Else
      stpContinuePkg.DisableStep = False
      stpExitPkg.DisableStep = True
   end if
    Main = DTSTaskExecResult_Success
End Function
help please for crying out loud


Thanks
 
I think you've made a typo...
Code:
varNumber = DTSGlobalVariables("numDays").Value
...
...
Set objParm =  objCommand.CreateParameter("@numDate", 3,1, 4,varNumber)

numDays != numDate


"We must fall back upon the old axiom that when all other contingencies fail, whatever remains, however improbable, must be the truth." - Sherlock Holmes

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top