Hello,
Using the following documentation as a guide:
http://msdn2.microsoft.com/zh-cn/library/aa337080.aspx
I instantiated a new script component into an existing Data Flow in my SSIS project.
In the Script Transformation Editor, under the Connection Managers section, I associated the name dbConnManager to an already existing Connection Manager in the project.
My Connection Manager is of the type oOLEDB.
I then opened up the script designer and added the following lines of code where it said "Add your code here"
Dim
myConnManager As IDTSConnectionManager90 = _ Me.Connections.ECFconnection
Dim dbConn As OleDb.OleDbConnection = _ CType(myConnManager.AcquireConnection(Nothing), OleDb.OleDbConnection)
When I test run the project I get the following error and the new script component is red:
Unable to cast COM object of type 'System.__ComObject' to class type 'System.Data.OleDb.OleDbConnection'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.
I know the database connection works since I am using it in a component that executes before this new script component.
I am stuck...Any suggestions