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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launch a DTS package from ActiveX task

Status
Not open for further replies.

Glowworm27

Programmer
May 30, 2003
587
US
I have a DTS package that imports a lot of data.

I now have a requirement to extract some of that data for a market program. I want to be able to run another dts package if a condition is true, otherwise finish processing.

how can I launch a packge from the ActiveX task?

Thanks in advance
[cannon]

George Oakes
Check out this awsome .Net Resource!
 
Its' pretty much the same way you'd do it from vba/vb6 (except you can't instantiate your object as a package). Something like this:

Code:
Function Main()

   'Create DTS Package object
	Dim objDTS 
	set objDTS = CreateObject("DTS.Package")

	'Load DTS Package
	objDTS.LoadFromSQLServer [b]"Server_Name"[/b], [b]"USERNAME"[/b], [b]"PASSWORD"[/b], _
	DTSSQLStgFlag_Default, , , , [b]"PACKAGE_NAME"[/b]
        
   'execute/uninitialize package
	objDTS.Execute
	objDTS.UnInitialize
    
   'dispose of object
	Set objDTS = Nothing

	Main = DTSTaskExecResult_Success
End Function

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top