When i execute the following code provided by msdn, it shows error on the line Application app = newApplication().
But i got some comments that it works fine in 64-bit machine. Could you please help me out. Thanks in advance.
Executed Code
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
namespace Connections_Collection
{
classProgram
{
staticvoid Main(string[] args)
{
// The package is one of the SSIS Samples.
string mySample = @."C:\Program Files\Microsoft SQL Server\90\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx";
// Create an application and load the sample.
Application app = newApplication();
Package pkg = app.LoadPackage(mySample, null);
Connections myConns = pkg.Connections;
int connCount = myConns.Count;
Console.WriteLine("The number of connections in the package is: {0}", connCount);
// Enumerate over the collection, printing out
// the values for various properties.
foreach (ConnectionManager connMgr in myConns)
{
Console.WriteLine("ConnectionString: {0}", connMgr.ConnectionString);
Console.WriteLine("CreationName: {0}", connMgr.CreationName);
Console.WriteLine("DelayValidation: {0}", connMgr.DelayValidation);
Console.WriteLine("Description: {0}", connMgr.Description);
Console.WriteLine("HostType: {0}", connMgr.HostType);
Console.WriteLine("ID: {0}", connMgr.ID);
Console.WriteLine("InnerObject: {0}", connMgr.InnerObject);
Console.WriteLine("Name: {0}", connMgr.Name);
Console.WriteLine("ProtectionLevel: {0}", connMgr.ProtectionLevel);
Console.WriteLine("SupportsDTCTransactions: {0}", connMgr.SupportsDTCTransactions);
}
Console.WriteLine("");
}
}
}
Error message
Retrieving the COM class factory for component with CLSID {E44847F1-FD8C-4251-B5DA-B04BB22E236E} failed due to the following error: 80040154.
Thanks,
Kalam
I am also facing the same problem. Can anybody help on this?
the Code works fine in a 32 bit machine but shows this on a 64 bit machine.
Any idea?
Thanks in advance
|||Try to upload the DTS from a 32 bit machine onto the 64 bit and probably it should work...|||Could you elaborate on this solution please ("upload the DTS")? What is involved with uploading DTS onto Windows Vista Business 64-bit? I also get the same error message for a program running in 64-bit mode that is trying to call a 32-bit DLL. Thanks.
No comments:
Post a Comment