So I created a ForEach loop and a data flow task to write from Excel to SQL DB. All works fine with the Excel source hard coded. As soon as I change the connection string to use the file path variable as a data source, I get this error:
[Excel Source 1] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager 1" failed with error code 0xC0202009.
I print the file path in a message box before executing the data flow so I know that the variable is working.
Naturally I browsed tons of answers and tutorials, but nothing. Here's what I tried:
- Changing the data source on the connection string
- Using the ExcelFilePath expression instead of the connection string
- Changing the Excel file name in the connection manager properties
- Ran the package in 32 bits
- Set delayed validation to True in all data flow tasks and connection manager
- Deleting and creating a new connection manager
- Combinations of the above, lots of trial an error
I'm using Visual Studio 2013.
I'd appreciate your help as I've been plucking my hair all afternoon with this :)