DTS How to... Execute a DTS Package from...
November 28, 19992 How to Execute a DTS Package from...
To execute a package first you need to load the package into an object, then simply use object.Execute method. To use the DTS objects enable the reference to the Microsoft DTSPackage Object Library. Here is an example for a server package.
Error checking should also form a part of any execution routine.
For this I'd recommend reading the Microsoft Knowledge Base Article:
For those that want more control, you can declare the package object WithEvents.
This gives you progress and error events as they happen. It also allows you to
cancel execution in a similar method to that used by the Enterprise Manager execution interface.
For more information about WithEvents and DTS, see the Microsoft Knowledge Base Article:
A limitation of executing packages from Visual Basic is the need to ensure all steps execute in the main thread.