By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,591 Members | 650 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,591 IT Pros & Developers. It's quick & easy.

DTS Error

P: n/a
I'm working with DTS packages from within C#. Everything works i
development and testing, but when I move the application to
production server (an IIS box without SQL installed on the same box) i
throws:

COM object with CLSID {10020202-EB1C-11CF-AE6E-00AA004A34D5} is eithe
not valid or not registered.

Any ideas what needs to be registered, or is there a way to incorporat
the necessary file with my app so a registration is not required?
Here's the code:

// Execute the DTS on SQL Server to export the data
createAccessDB(strAccessDB, strCreateTableSQL);
string strSQLServerName
ConfigurationSettings.AppSettings["SQLServerName"];
string strSQLConnection
ConfigurationSettings.AppSettings["DBConn"];
string strSQLUserID
ConfigurationSettings.AppSettings["SQLUserID"];
string strSQLPassword
ConfigurationSettings.AppSettings["SQLPassword"];

Microsoft.SqlServer.DTSPkg80.Package2 package = ne
Microsoft.SqlServer.DTSPkg80.Package2Class();
UCOMIConnectionPointContainer CnnctPtCont
(UCOMIConnectionPointContainer) package;
UCOMIConnectionPoint CnnctPt;
PackageEventsSink PES = new PackageEventsSink ();
Guid guid = new Guid("10020605-EB1C-11CF-AE6E-00AA004A34D5"); /
UUID of PackageEvents Interface
CnnctPtCont.FindConnectionPoint(ref guid, out CnnctPt);
int iCookie;
CnnctPt.Advise(PES, out iCookie);
object pVarPersistStgOfHost = null;

package.LoadFromSQLServer(strSQLServerName, strSQLUserID
strSQLPassword
Microsoft.SqlServer.DTSPkg80.DTSSQLServerStorageFl ags.DTSSQLStgFlag_Default
null, null, null, strDTSPackageName, ref pVarPersistStgOfHost);
foreach (Microsoft.SqlServer.DTSPkg80.GlobalVariable colGlobalVar
in package.GlobalVariables)
{
if (colGlobalVars.Name=="sServerName" |
colGlobalVars.Name=="sAccessDB" || colGlobalVars.Name=="UserID" |
colGlobalVars.Name=="Password")
{
package.GlobalVariables.Remove(colGlobalVars.Name) ;
}
}

try
{
package.GlobalVariables.AddGlobalVariable("sServer Name"
strSQLServerName);
package.GlobalVariables.AddGlobalVariable("sAccess DB"
strAccessDB);
package.GlobalVariables.AddGlobalVariable("UserID" , strSQLUserID);
package.GlobalVariables.AddGlobalVariable("Passwor d"
strSQLPassword);
package.AutoCommitTransaction=true;
package.WriteCompletionStatusToNTEventLog=true;
package.Execute();
package.UnInitialize();
package = null;
}
catch(System.Runtime.InteropServices.COMException ex)
{
...
}

catch(System.Exception ex)
{
...

-
robrichar
-----------------------------------------------------------------------
posted via www.WebFrustration.com

Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.