question

billj avatar image
billj asked

Msg 7303, Level 16, State 1, Line 1

Hello, After running the following query, SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0; Database=C:\temp\test.xlsx', [Sheet1$]) I'll get this error 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)". Please help me. Thanks.
sql-server-2008-r2openrowset
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

You have some good answers below. This web site runs by you voting and marking the best answers. For each helpful answer below, indicate this by clicking on the thumbs up symbol next to those answers. If any one answer lead to a solution, indicate this by clicking on the check mark next to that answer. This helps indicate your solution for anyone else with the same question.
0 Likes 0 ·
happycat59 avatar image
happycat59 answered
There are 2 potential issues 1. have you installed the OLEDB provider on the server ? 2. does the spreadsheet actually exist on the server (in C:\temp)
2 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello, The answer to your both questions are 'YES'.
1 Like 1 ·
happycat59, Any idea to resolve the error issue? Thanks.
0 Likes 0 ·
happycat59 avatar image
happycat59 answered
Can you check the permissions that the SQL Server service account has in c:\temp. It will need to be able to write to this folder (when you open an Excel file, the provider creates a file in c:\temp - it contains, I think, who has the file open).
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.