• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2820
  • Last Modified:

Wait 10 seconds in DTS package

Experts,

I am creating a DTS package that uses ActiveX scripts.  What I need is for the DTS package to wait 10 seconds before it goes on to the next step in the DTS package.  

Thanks a lot!  


***You don't need to read below- unless you want further explanation
Using the code "main = DTSTaskExecResult_Success" will not work.  I have to have the DTS package wait 10 seconds, before going on to the next step.  Also, I prefer to have this in one DTS package.

0
jjrr007
Asked:
jjrr007
  • 5
  • 3
  • 3
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
0
 
Anthony PerkinsCommented:
You can also write some ActiveX code in an ActiveX Script Task.
0
 
jjrr007Author Commented:
How do I incorporate the WAITFOR DELAY '0:00:10'  into the ActiveX Control? Please advise.

I have raised the points, because of the difficulty.  

Thanks!
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>WAITFOR DELAY '0:00:10'
that is to be put into a SQL step.

In a ActiveX Script Step:
 WScript.Sleep(10000)
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
correct:

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Sleep(10000)
0
 
jjrr007Author Commented:
Is this for ten seconds?

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Sleep(10000)
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
yes. the argument of Sleep is in milliseconds.
0
 
jjrr007Author Commented:
Angel,

I tried that and got object required.  I tried to declare it using Dim, I got WScript method not allowed.  Please advise...
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I should start rereading my comments before posting :-)

dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.Sleep(10000)
0
 
Anthony PerkinsCommented:
Sleep is a method that belongs to the WScript object. WScript does not need to be instantiated:

<quote>
The WScript object is the root object of the Windows Script Host object model hierarchy. It never needs to be instantiated before invoking its properties and methods, and it is always available from any script file.
</quote>

So this will work in a VBS script:
WScript.Sleep 3000
MsgBox "Done!"

Having said it does not appear to be available in DTS.

0
 
Anthony PerkinsCommented:
For a crappy solution (just watch your CPU remain at 100% for 10 seconds) and providing you do not run at midnight, you can use something like this:

Dim Start
Start = Timer
Do While Start + 10 > Timer
Loop

Perhaps you should reconsider and use angelIII solution using WAITFOR DELAY or tell us why you need to wait 10 seconds.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now