Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
podgehb
Starting Member
18 Posts |
Posted - 2007-07-06 : 12:42:16
|
I am trying to run a SSIS package (called "Parent") that calls another package (called "Child"). The packages are stored in SQL Server (MSDB database) and are called from a console app by the code below: Public Shared Function RunPackage(ByVal server As String, _ ByVal userName As String, _ ByVal password As String, _ ByVal packageName As String, _ ByVal packagePassword As String) As String Dim pkg As New Package Dim app As New Application Dim pkgResults As DTSExecResult Dim result As String = "" app.PackagePassword = packagePassword pkg = app.LoadFromSqlServer(packageName, server, userName, password, Nothing) pkgResults = pkg.Execute() result = pkgResults.ToString() & vbNewLine For Each err As DtsError In pkg.Errors result += "Task: " & err.Source & vbNewLine result += ParseErrorMessage(err.Description) & vbNewLine Next Return resultEnd FunctionIf I just run the Child package with this code, then it works! But is I run the Parent package from the same code, then it fails with this error: "Error 0x80004002 while preparing to load the package. No such interface supported".The only difference between the 2 packages is that the Parent calls the Child, and the Child calls nothing.The Connection Manager in Parent used to connect to Child uses SQL Server Authentication and it needs to be that. My question: From VB.NET, how do I run a SSIS package that calls another package? |
|
podgehb
Starting Member
18 Posts |
Posted - 2007-07-16 : 06:59:11
|
It works now. You need to put "<MTAThread()> _" ahead of "Sub Main()" in the console app that calls the SSIS package. |
 |
|
|
|
|
|
|