In article <000901c3ad35$b5948fb0$a501280a (AT) phx (DOT) gbl>, Fly Girl
<gschipper (AT) rgl (DOT) net> writes
Quote:
Windows 2K and SQL Server 2K
When I run the following code I get an error: "An
exception of type 'Microsoft (sic) VBScript runtime error:
Object required: 'WScript" (sic) was not handled." |
<snip>
Quote:
The code errors on the line for WScript.Sleep.
Any suggestions? I need to have the script task wait until
I the executable has run and finished it's process.
Thanks! |
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.
The Echo can be replaces with the MsgBox function or statement.
You could try the Run method instead as this has the bWaitOnReturn
parameter, but it not quite the same as Exec.
Or
Use the Execute Process Task to call the program. This waits for you.
--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com
PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org