Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Loading data from Exel 2007 file


Loading data from Exel 2007 file

Author
Message
mcginn
mcginn
SSC Journeyman
SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)

Group: General Forum Members
Points: 76 Visits: 316
I can not access an excel file that has no permission issues.

I have SQL Server 2008 R2 installed on a Windows 7 32 bit PC. I down loaded and installed 'Microsoft Access database engine 2010'.

I updated the server config with:
sp_configure 'Ad Hoc Distributed Queries',1
reconfigure

I accessed the Microsoft.ACE.OLEDB.12.0 properties and checked 'Dynamic Parameter' and 'Allow inprocess'

I login with my windows auth account and issued the command:
SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'EXCEL 12.0 Xml;Database=C:\Users\Public\Documents\Copy1.xlsx; HDR=YES','SELECT * FROM [Sheet1$]');

which fails with the message:
OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "Unspecified error".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".

I have been searching the net for more then a day now and I can not find anything that would help me resolve this issue. Any ideas?
HanShi
HanShi
Hall of Fame
Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)

Group: General Forum Members
Points: 3049 Visits: 3633
I guess you have a typo of some kind in the connection string. Can you access and load from the Excel file using the import/export wizard?
When you save the import/export wizard as an SSIS package, you are able to see the connection string used by the package. Perhaps this connection string can lead you to the correct connection string for use with OPENROWSET.

** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
mcginn
mcginn
SSC Journeyman
SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)SSC Journeyman (76 reputation)

Group: General Forum Members
Points: 76 Visits: 316
Via the import/export wizard I can readily import the Excel file. I copied the connection string from the generated SSIS file and tried that in my query window and I have the same non-descript error. I even (thinking it was a permission error ) changed the system TMP and TEMP values to point to c:\tmp and changed the permission to EVERYONE. It had no affect.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search