December 8, 2017 at 12:48 am
Hi,
I am trying to export the SQL (Server 2012) data to Excel file. I tried the below query
INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;
Database=C:\DataIssue.xlsx','SELECT * FROM [Sheet1$]')
SELECT emplid,deptid FROM employees
And got this error
Msg 7399, Level 16, State 1, Line 2
The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 2
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
Please provide the solution to resolve it.
Thanks.
December 10, 2017 at 4:55 pm
Balz - Friday, December 8, 2017 12:48 AMHi,
I am trying to export the SQL (Server 2012) data to Excel file. I tried the below queryINSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;
Database=C:\DataIssue.xlsx','SELECT * FROM [Sheet1$]')
SELECT emplid,deptid FROM employees
And got this error
Msg 7399, Level 16, State 1, Line 2
The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 2
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".Please provide the solution to resolve it.
Thanks.
On which machine is the "C:\DataIssue.xlsx" file? The SQL Server or somewhere else? If it's NOT on the SQL Server itself, then you need to define a share where the file is an use a UNC to connect to the spreadsheet. If it IS on the server, then I strongly suggest you pick some other directory other than the root of the most important drive on the entire server. I'm not even sure that SQL Server can see the root of the server's C: Drive without granting it some permissions, which you should not. Certainly, I would not give individuals privs to the root of the C: Drive.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy