How do I run an SSIS package from VBA application?
Posted on 2008-10-02
I have a VBA application that executes a SQL Server SSIS package. When it executes I get the this error (please see message box)
This is the code I'm using in my application:
Dim oPKG As New DTS.Package
oPKG.LoadFromSQLServer "MBC_Laptop", , , _
DTSSQLStgFlag_UseTrustedConnection, , , , "MBC_Net"
Set oPKG = Nothing
Please note that I can execute the package directly from the server. I can also execute it from VB.Net application using the following code:
Dim pkgLocation As String
Dim pkg As New Package
Dim app As New Application
Dim pkgResults As DTSExecResult
pkgLocation = _
"D:\VB Projects\My Test Procedures\Import New Media Stats\Import New Media Stats\bin\Deployment\MBC_Net.dtsx"
pkg = app.LoadPackage(pkgLocation, Nothing)
pkgResults = pkg.Execute()
Could someone please advise me how to run SSIS from VBA application