Search

onze sponsors

microsoft_logo.gif


 

computrain_logo.JPG

Forum Login | Register
   Forum

 

Subject: SSIS Custom component
Prev Next
You are not authorized to post a reply.

Author Messages
Antoon VansinaUser is Offline

Posts:17

10-07-2007 10:24:59 Alert 
Kan er iemand helpen met het volgende probleempje?

I'm creating an custom data destination component and have been using the MS
examples and some examples on the internet to get it right.
I Keep getting an error in the AquireConnections method and I can't figure
out why.

The method is:
"CA2201:DoNotRaiseReservedExceptionTypes")> _
    Public Overloads Overrides Sub AcquireConnections(ByVal transaction As
Object)
        If ComponentMetaData.RuntimeConnectionCollection.Count = 1 Then
            Dim connection As IDTSRuntimeConnection90 =
ComponentMetaData.RuntimeConnectionCollection(0)
            If Not (connection.ConnectionManager Is Nothing) Then
                Dim cm As ConnectionManager =
DtsConvert.ToConnectionManager(connection.ConnectionManager)
                Dim con As ConnectionManagerOleDb = CType(cm.InnerObject,
ConnectionManagerOleDb)
                If con Is Nothing Then
                    Throw New Exception("The ConnectionManager " + cm.Name +
" is not a Oledb connection manager.")
                Else
                    conSQL = CType(con.AcquireConnection(transaction),
OleDbConnection)
                    If conSQL Is Nothing Then
                        Throw New Exception("The ConnectionManager " +
cm.Name + " is not a oleDB connection manager.")

                    End If
                End If
            End If
        End If
    End Sub

The statement
Dim con As ConnectionManagerOleDb = CType(cm.InnerObject,
connectionManagerOleDb)
trows an error:
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.

The connection that I'm adding is a native OleDB connection to a SQL db.
I tried changing everything to ado.net (code and connection): same problem

If I try
ctype(cm.InnerObject, ConnectionManagerOleDb     ).ConnectionString
in the Watch window I do get a result ?!
Could this have anything to do with security settings? (ProtectionLEvel =
DTSPL_ENCRYPTSENSITIVE_USERKEY {1}) or some general option?

Antoon VansinaUser is Offline

Posts:17

30-08-2007 17:30:01 Alert 
Ben er uiteindelijk uitgeraakt. Heb heel de boel op http://antoon.blog.com//SSIS+-+Error+logging/ gezet
You are not authorized to post a reply.
Forums > Forums > Business Intelligence > SSIS Custom component



ActiveForums 3.6
  
Copyright (c) 2012 PASS Nederland   Privacy Statement  Terms Of Use