Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Problem: Triggering SSIS package (Excel to SQL Server) from a Windows Service (WMI)

$
0
0

Hello everyone,

I've just started with SSIS and my mission is to insert Excel-data to SQL Server 2012.

I've read quite a few blogs, articles about the problem that I have with SSIS but I'm not sure where to start to get this one fixed.

What do I do: So I have a package in a Windows Server 2008R2 environment that has a for each container which will go through all the excel files in a folder and insert the data to a sql table. Having set the "Run64BitRuntime" to false, this works from within BIDS. Even if I use the 32-bit DTEXEC this also works.

What doesn't work is this: I have created a WindowsService (with WMI) that watches over the specified folder and triggers the package when new files arrive. I created this service for x86-platform and when I check with corflags the 32-bit is set to 1. The service does trigger the package but creates errors.

Here are the errorcodes that I am getting:

Translated from German:

when the windows service is running:


SSIS-Errorcode 'DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER'.Error calling AcquireConnection-Method through Connection-Manager 'OLEDB_Destination_Conn'

and  sometimes I get the following error: (I can't replicate it right now)

Error: 0xC0202009 at SSIS Load Excel, Connection-Manager 'Excel_Source': SSIS-Errorcode'DTS_E_OLEDBERROR'. OLE DB-Error.Errorcode: 0x80004005....Source: 'Microsoft Office Access Database Engine' HRESULT: 0x80004005Description: 'Unexpected error from external database driver (????????).'.

I use a variable to set the connection string, which looks like this: Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\SSISLoad\NewData\Files\Test\imaginary.xlsx;Extended Properties="EXCEL 12.0 XML;HDR=YES;IMEX=1";

Within the service I run the package like so:

pkg.Execute();

I've noticed that when I use a different SSIS package with a SQL-Task to simply insert some test data I can't get a connection with the WindowsService but it works again with BIDS and DTEXEC.

Could this be 64-bit related, maybe an authentication problem or is one of the drivers messed up but why can I run the package within BIDS or from the command line?

I will probably create another Excel project and see if the same error appears again. Maybe I should also try and see if I can use a job agent to get the package to execute.

Hopefully you have some tips in the meantime.

thanks a lot.



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>