?
Solved

How do I run an SSIS package from VBA application?

Posted on 2008-10-02
4
Medium Priority
?
3,444 Views
Last Modified: 2013-11-10
Hello Experts,

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:

Sub ExecutePackage()
    Dim oPKG As New DTS.Package
    oPKG.LoadFromSQLServer "MBC_Laptop", , , _
        DTSSQLStgFlag_UseTrustedConnection, , , , "MBC_Net"
    oPKG.Execute
    oPKG.UnInitialize
    Set oPKG = Nothing
End Sub

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:

    Sub RunSSIS()

        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()

        Console.WriteLine(pkgResults.ToString())
    End Sub

Could someone please advise me how to run SSIS from VBA application
0
Comment
Question by:Mehawitchi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 

Author Comment

by:Mehawitchi
ID: 22623372
Here is the error message
error-message.jpg
0
 
LVL 22

Expert Comment

by:PedroCGD
ID: 22623415
Dear Friend,
I've posted some time ago in my blog a post abou calling ssis package from an ASP application. Maybe it help you... check www.pedrocgd.blogspot.com

just a tip : Calling a SSIS package from a asp application from a ASP siet requires SSIS installed on websserver... in your case you must have SSIS installed in machine you have the excel file...

I hop it helps you!
regards
0
 

Author Comment

by:Mehawitchi
ID: 22624912
Thanks Pedro,

You do have an interesting website, but unfortunately it does not help in my problem.

My problem is related to VBA not ASP.

On a separate note, I wanted also to go to BI Conference in Seatle, but couldn't afford. May be we meet next conference.

Cheers,
0
 
LVL 22

Accepted Solution

by:
PedroCGD earned 1500 total points
ID: 22624949
The code in VBA and in ASP (VB.NET) is similar...
try it!
Leave a comment in blog to know you better and speak a little!
give feedback!
regards!!
Pedro
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question