fpvmorais / EzApi2016

Fork of EzApi adapted for SQL Server 2016
http://fpvmorais.github.io/EzApi2016
13 stars 16 forks source link

InteropServices.COMException #9

Closed hervema closed 3 years ago

hervema commented 3 years ago

Hello,

I know this project is "old", however it could be suit perfectly with my needs. I have a project generating SSIS packages automatically. It works perfectly with SQL 2008R2 to SQL 2012. Moving to SQL 2016 now, this fork of EzApi is a miracle :-)

However if more than 95% of the code is working with this fork, i got an error on AcquireConnections method in EzComponents

This error is not always and for a reason I don't understand, sometimes I get a InteropServices.COMException.

I don't know which information I could give to help on this problem.

In my screenshots attached, I give some information. Is this could help ?

Many thanks if you could help me or give me some tips.

Regards,

Hervema

SometimesItWorks SometimesNOT ACluePerhaps

fpvmorais commented 3 years ago

Hi,

Without a minimal working example to test its hard to pinpoint the possible issue. Looking at your screenshots my guess is that SSIS tries to validate the connections to the sources and destinations while generating the packages and fails on that point. When you were generating did you have a working connection to those source/destination?

fpvmorais commented 3 years ago

https://docs.microsoft.com/en-us/sql/integration-services/integration-services-error-and-message-reference?view=sql-server-ver15

0xC020801C | -1071611876 | DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER | SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "%1" failed >with error code 0x%2!8.8X!. There may be error messages posted before this with more information on why the AcquireConnection method call failed.

Also found this:

https://jimsalasek.com/2017/05/22/ssis-error-code-0xc020801c/

And this: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/8f32273b-7f7d-4258-a595-d9017904e88c/exception-from-hresult-0xc020801c-getting-this-error-while-trying-to-execute-programitically?forum=sqlintegrationservices

Tell me if it helped you.

Best regards

hervema commented 3 years ago

Yeahhh !! Thanks you so much, your clue "When you were generating did you have a working connection to those source/destination?" was the good one ! :-) In fact the source and destination are working during debug, but the part of code generating dynamic datasources contained errors in provider used.... and this was the reason of random errors : some datasources were correctly formed for some other not !! Great. You save me. Thanks a lot again. Best regards.