Thursday, July 05, 2007

I was trying to figure out how to get some data from an ODBC source and put it into SQL, and found a post with an interesting possible answer: 

Recently, I discovered an issue with SQL Server Integration Services (SSIS) regarding how the Execute SQL Task item handles returning a result set to the control flow. Lets start by demonstrating an existing issue with the Execute SQL Task using ODBC then I'll present a solution. First, create a new DSN that points to the database using the ODBC Data Sources Administrator (Control Panel | Administrator Tools | ODBC Data Sources). If you are only dealing with SQL Server you can still test this out by creating a DSN that uses the SQL Server ODBC driver.

Sql Server Integration Service (SSIS) Execute SQL Task ODBC Result Set Bug/Workaround

Thursday, July 05, 2007 1:16:52 PM (Central Standard Time, UTC-06:00)  #    Comments [1]
Monday, July 23, 2007 4:52:55 PM (Central Standard Time, UTC-06:00)
I am trying your ODBC work around but getting this error on the CTYPE line:

Dim conn As Odbc.OdbcConnection = CType(Dts.Connections(0).AcquireConnection(Nothing), Odbc.OdbcConnection)

The error it get is:

Unable to cast COM object of type 'System.__ComObject' to class type 'System.Data.Odbc.OdbcConnection'. 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.
Gary Hopkins
Comments are closed.