washaw
Programmer
- Feb 13, 2008
- 48
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.
help please for crying out loud
Thanks
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
Thanks