Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute a DTS Package from VBA 6

Status
Not open for further replies.

p27br

Programmer
Aug 13, 2001
516
GB
Hello,

I thought this might be useful to someone.
If you need to execute a DTS package from a VBA module in your ADP, follow these steps :

Create your DTS package in SQL Server and choose Save As.
In the Save DTS Package window scroll down the Location combobox and choose Visual basic File. Save it to your directory. The result is your DTS package is now a text file containing the VB code. You may now import this file into your ADP as a module. The main procedure is called Main(). You can rename it to something more meaningfull then call it from your code, it will execute your DTS package.

 
Thanks for that. It will prove useful.
 
This is great Thanks! I am getting a user-defined type not defined error? I am new to this so it's probably somthing I am doing. Any help would be great.
Thanks,
jbrowndog
 
you must include the reference to Microsoft DTSPackage Object Library
 
Thanks, p27br. This was exactly what I was looking for earlier this morning. Have a star.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top