SQL SERVER – The OLE DB Provider “Microsoft.ACE.OLEDB.12.0” for Linked Server “(null)” Reported an Error. Access Denied

SQL
9 Comments

Here is another blog which explains a situation I was in while reading data from excel. In this blog, we would talk about error “Access Denied” error while using The OLE DB provider “Microsoft.ACE.OLEDB.12.0” for linked server.

I was using the following query to read the data from excel. Filename “SQLAuthority.xlsx” and sheet name was “Sheet1”.

SELECT * FROM OPENROWSET(
'Microsoft.ACE.OLEDB.12.0'
,'Excel 12.0;Database=F:\Backup\SQLAuthority.xlsx;HDR=YES'
,'SELECT * FROM [Sheet1$]')

The error message while running the query is as follows.

Msg 7399, Level 16, State 1, Line 1
The OLE DB provider “Microsoft.ACE.OLEDB.12.0” for linked server “(null)” reported an error. Access denied.
Msg 7350, Level 16, State 2, Line 1
Cannot get the column information from OLE DB provider “Microsoft.ACE.OLEDB.12.0” for linked server “(null)”.

If you observe in the image, the path, file name etc. are correct.

Solarwinds

SQL SERVER - The OLE DB Provider "Microsoft.ACE.OLEDB.12.0" for Linked Server "(null)" Reported an Error. Access Denied excel-ad-01

Here is the content of the excel file.

SQL SERVER - The OLE DB Provider "Microsoft.ACE.OLEDB.12.0" for Linked Server "(null)" Reported an Error. Access Denied excel-ad-02

Since we can see “Access Denied” in the message, I tried all possible permissions to file, folder, everyone, full control etc. but none helped. I also tried explicit permission to service account NT Service\MSSQLSERVER.

SOLUTION/WORKAROUND

As I mentioned, I checked service account and it was set as NT Service\MSSQLSERVER.

I changed that to Local System as shown below and restarted the service.

SQL SERVER - The OLE DB Provider "Microsoft.ACE.OLEDB.12.0" for Linked Server "(null)" Reported an Error. Access Denied excel-ad-03

And then it started working.

SQL SERVER - The OLE DB Provider "Microsoft.ACE.OLEDB.12.0" for Linked Server "(null)" Reported an Error. Access Denied excel-ad-04

Have you seen this error and found some other solution? If yes, please write in the comment box below to help others.

Reference: Pinal Dave (https://blog.sqlauthority.com)

Solarwinds
, , ,
Previous Post
SQL SERVER – What is the Meaning of PREEMPTIVE_HTTP_EVENT_WAIT? How to Fix it?
Next Post
SQL SERVER – Unable to Uninstall – Index was Outside the Bounds of the Array

Related Posts

9 Comments. Leave new

  • Rama Koteswararao Yenigandla
    December 4, 2018 9:23 am

    Open SQL Server with Run as administrator option, then also we can avoid this error.

    Reply
  • Hi Pinal

    I have seen this error before , usually I grant sql server service account permissions to this file and it works, in your case however this account was not a windows account so you could have tried to give the computer account permissions to this file. Its always recommended to run SQL server with a windows account if interacting with other SQL servers or the file system.

    Reply
  • Why does it work with “Local System” account and not with “NT Service\MSSQLServer” account.

    Reply
  • Network Service Account

    The Network Service account is a built-in account that has more access to resources and objects than members of the Users group. Services that run as the Network Service account access network resources by using the credentials of the computer account in the format \$. The actual name of the account is NT AUTHORITY\NETWORK SERVICE.

    Local System Account

    Local System is a very high-privileged built-in account. It has extensive privileges on the local system and acts as the computer on the network. The actual name of the account is NT AUTHORITY\SYSTEM

    Reply
  • “NT Service\MSSQLServer” is a virtual account it would not have access to the file system

    Reply
  • Hi,
    I want to create a Linked server from SQP SERVER 2005 to SQL SERVER 2016,
    Can it will be possible to create a link server from 2005 to 2016..
    Thanks

    Reply
  • thank you! I waste few hours with this error and then I saw your article which save me.

    Reply
  • I am late to the party but I just wanted to add that your solution works!

    Reply

Leave a Reply

Menu