Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

sql server authorization faiing using oledb connection

$
0
0

In my package I am using OLEDB connection and also referencing from the script task  In OLEDB connection I am using as SQL Authorization to log in. My script failing, it used to work when it was set to using Windows Authentication.

In previous version of this package I was using windows authentication, I had 2 connections in my connection manager, ADO.NET used in script task and oledb used in other controls. Package ran fine. But when I decided to use SQL Authrization I modified my pacakge based on the following post

http://blogs.msdn.com/b/mattm/archive/2008/08/22/accessing-oledb-connection-managers-in-a-script.aspx

The pacakge works locally but not able to run from sql agent.

I would appreciate if you help me debug this issue.

Thank you.

ConnectionManager cm = Dts.Connections["ServerConnection"];
            IDTSConnectionManagerDatabaseParameters100 cmParams = cm.InnerObject as IDTSConnectionManagerDatabaseParameters100;
            OleDbConnection sqlConn = cmParams.GetConnectionForSchema() as OleDbConnection;
            OleDbCommand sqlComm;
            sqlCommand = "select CurrentPassword, ExpiryDate from UsrPswd where UserID = '" + UserID + "'";
            //MessageBox.Show("sqlCommand = " + sqlCommand);
            sqlComm = new OleDbCommand(sqlCommand, sqlConn);
            //OleDbDataReader rdr = sqlComm.ExecuteReader();
            using (OleDbDataReader rdr = sqlComm.ExecuteReader())
            {
                while (rdr.Read())
                {
                    CurrentPassword = rdr.GetString(0);
                    PasswordExpiryDt = rdr.GetDateTime(1); //rdr.GetString(1);
                }
            }
            cm.ReleaseConnection(sqlConn);

Message
Executed as user: .\00DW_MSSQL_AGENT. Microsoft (R) SQL Server Execute Package Utility  Version 10.50.2500.0
for 64-bit  Copyright (C) Microsoft Corporation 2010. All rights reserved.   
Started:  6:30:00 AM 
Error: 2012-12-31 06:30:01.04   
Code: 0xC001405F    
Source:       Description: Failed to decrypt an encrypted XML node because the password was not specified or not correct.
Package load will attempt to continue without the encrypted information. 
End Error 

Error: 2012-12-31 06:30:01.32    
Code: 0xC0202009    
Source: PackageName Connection manager "ServerConnection"    
Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred.
Error code: 0x80040E4D.  An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0" 
Hresult: 0x80040E4D
Description: "Invalid authorization specification". 
End Error 

Error: 2012-12-31 06:30:01.33    
Code: 0xC020801C    
Source: Check Rows Before Execution OLE DB Source [1]    
Description: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. 
The AcquireConnection method call to the connection manager "ServerConnection" failed with error code 0xC0202009. 
There may be error messages posted before this with more information on why the AcquireConnection method call failed. 
End Error 

Error: 2012-12-31 06:30:01.34    
Code: 0xC0047017   
Source: Check Rows Before Execution SSIS.Pipeline    
Description: component "OLE DB Source" (1) failed validation and returned error code 0xC020801C. 
End Error 

Error: 2012-12-31 06:30:01.34    
Code: 0xC004700C    
Source: Check Rows Before Execution SSIS.Pipeline    
Description: One or more component failed validation. 
End Error 

Error: 2012-12-31 06:30:01.34    
Code: 0xC0024107    
Source: Check Rows Before Execution     
Description: There were errors during task validation. 
End Error 
DTExec: The package execution returned DTSER_FAILURE (1). 
Started:  6:30:00 AM  Finished: 6:30:01 AM  Elapsed:  0.532 seconds. 
The package execution failed.  The step failed.


Viewing all articles
Browse latest Browse all 24688

Trending Articles