Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

Error with SSIS and Excel Expand / Collapse
Author
Message
Posted Monday, April 18, 2011 5:43 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, July 2, 2014 3:59 PM
Points: 213, Visits: 572
I am trying to use the Excel Connection Manager in SSIS 2008 R2. I have set Run64BitRuntime = false. I have tried to process several .xls files that have one worksheet. But I get an "unexpected error from external database driver (22)" message from them. When I use the original worksheet tab name (for example, POS Report-XXXX BRANDS-YYYYYYY), I get the error. But if I rename the worksheet tab something simple like "TEST" I don't get the error. Is there a way around this other than manually renaming the tab for each .xls file?
Post #1095372
Posted Tuesday, April 19, 2011 12:10 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:51 PM
Points: 13,639, Visits: 10,534
The space in the name is possibly the issue.
Try writing a SQL query to your Excel file instead of just selecting the sheet name in the dropdown list.
There you can put the sheet name in brackets, what will solve the issue:

[POS Report-XXXX BRANDS-YYYYYYY$]




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1095430
Posted Tuesday, April 19, 2011 10:51 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, July 2, 2014 3:59 PM
Points: 213, Visits: 572
I tried

SELECT * FROM [SHEET NAME$]

I received the following error. Is my syntax incorrect?

TITLE: Microsoft Visual Studio
------------------------------

Error at XXXX_YYY_WEEKLY [Connection manager "Excel Connection Manager 1"]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft JET Database Engine" Hresult: 0x80004005 Description: "Unexpected error from external database driver (22).".

Error at Data Flow Task [Excel Source [29]]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager 1" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.



------------------------------
ADDITIONAL INFORMATION:

Exception from HRESULT: 0xC020801C (Microsoft.SqlServer.DTSPipelineWrap)

------------------------------
BUTTONS:

OK
------------------------------
Post #1095823
Posted Tuesday, April 19, 2011 11:12 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:51 PM
Points: 13,639, Visits: 10,534
There is a query builder that you can use. That way you don't have to worry about syntax.
I would advise you however not to use SELECT *, but to specify the column names.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1095838
Posted Tuesday, April 19, 2011 11:25 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, July 2, 2014 3:59 PM
Points: 213, Visits: 572
When I try the query builder I get the following error.

TITLE: Microsoft JET Database Engine
------------------------------

Unexpected error from external database driver (22).

------------------------------
BUTTONS:

&Retry
Cancel
------------------------------
Post #1095849
Posted Tuesday, April 19, 2011 11:27 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:51 PM
Points: 13,639, Visits: 10,534
You don't have the Excel file open, so it is locked?



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1095850
Posted Tuesday, April 19, 2011 11:36 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, July 2, 2014 3:59 PM
Points: 213, Visits: 572
I corrected the SQL syntax so now it works.

SELECT [POS Report-XXXX BRANDS-YYYYYYYY$].*
FROM [POS Report-XXXX BRANDS-YYYYYYYY$]
Post #1095855
Posted Tuesday, April 19, 2011 11:41 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:51 PM
Points: 13,639, Visits: 10,534
imani_technology (4/19/2011)
I corrected the SQL syntax so now it works.

SELECT [POS Report-XXXX BRANDS-YYYYYYYY$].*
FROM [POS Report-XXXX BRANDS-YYYYYYYY$]


Ah, apparently the table needs to be aliased. Strange...

But my advise still stands: drop the * and use the real columns.
If someone types into a non-used column and then deletes the data, SSIS will still think there is a new column and it will add the column to the dataflow, resulting in a package failure.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1095857
Posted Tuesday, April 19, 2011 11:57 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, July 2, 2014 3:59 PM
Points: 213, Visits: 572
I spoke too soon. When I try to run the package, I get the following error:

Error at Data Flow Task [Excel Source [29]]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.


Error at Data Flow Task [SSIS.Pipeline]: component "Excel Source" (29) failed validation and returned error code 0xC020801C.


Error at Data Flow Task [SSIS.Pipeline]: One or more component failed validation.


Error at Data Flow Task: There were errors during task validation.


Error at XXXXXX_POS_WEEKLY [Connection manager "Excel Connection Manager"]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft JET Database Engine" Hresult: 0x80004005 Description: "Unexpected error from external database driver (22).".
Post #1095871
Posted Tuesday, April 19, 2011 12:03 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:51 PM
Points: 13,639, Visits: 10,534
The package already fails at validation. Does the package has permission to access the folder where the Excel file is stored?
The Excel file isn't locked by another process?

This may sound silly, but have you tried turning it off and on again?
Restart BIDS, it may help.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1095873
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse