![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, Can you please tell me why this wont work in an ActiveX task in a DTS package...? --- Function Main() set WshShell = CreateObject("WScript.Shell") WScript.Sleep 1800000 set WshShell = nothing Main = DTSTaskExecResult_Success End Function --- Basically I need to wait 30 mins withing a DTS package - could I do this like in VBS/JS/ActiveX somehow? Best regards Jakob |
#3
| |||
| |||
|
|
In article <ekuDFjCuDHA.2308 (AT) TK2MSFTNGP11 (DOT) phx.gbl>, Sokrates someone (AT) somewhere (DOT) com> writes Hi, Can you please tell me why this wont work in an ActiveX task in a DTS package...? --- Function Main() set WshShell = CreateObject("WScript.Shell") WScript.Sleep 1800000 set WshShell = nothing Main = DTSTaskExecResult_Success End Function --- Basically I need to wait 30 mins withing a DTS package - could I do this like in VBS/JS/ActiveX somehow? Best regards Jakob WScript is an implicit object available in the WSH host. You are not running under WSH, although you are using the same language. Your host is the DTS ActiveX Script host, which does not the WScript object, it offers things like DTSGlobalVariables instead. One downside of this is that Sleep is not exposed as an object method on something that you can create, so you cannot call it in an DTS ActiveX Script. Your syntax is actually trying to call the Sleep method of the Shell object, but that does not exist, since Sleep is only exposed on the implicit WScript under WSH. How about using an Execute SQL Task and the T-SQL WAITFOR statement. -- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals http://www.sqlpass.org |
![]() |
| Thread Tools | |
| Display Modes | |
| |