This has been covered many times . . .
but here goes:
Reference: dtspkg.dll
Dim objPackage As DTS.Package2
'Instanciate the DTS package object
Set objPackage = New DTS.Package2
'Set the server/username/password and the DTS package to be run
objPackage.LoadFromSQLServer ServerName, UserName, Password, DTSSQLStgFlag_Default, "", "", "", "DTS_Name"
'Pass the Global variables - date values to the DTS Package
objPackage.GlobalVariables("FromDate".Value = dtpFrom.Value
objPackage.GlobalVariables("ToDate".Value = dtpTo.Value
'Set object to raise an error on failure and to do eventlogs
objPackage.FailOnError = True
objPackage.WriteCompletionStatusToNTEventLog = True
'Run DTS Package
objPackage.Execute
objPackage.UnInitialize
'Mark objects for garbage collection
Set objPackage = Nothing
Hope you find this useful.
I was standing in the park, wondering why frisbees got bigger as they came closer... then it hit me!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.