title: SQL Server: Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)"
body: <p>I am trying to run the following query:</p>
  
  <pre><code>SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
  'Excel 12.0;Database=C:\Somefile.xlsx',
  'SELECT * FROM [Sheet$]')
  </code></pre>
  
  <p>But I get this error:</p>
  
  <pre><code>Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
  </code></pre>
  
  <p>I tried the following:</p>
  
  <pre><code>sp_configure 'show advanced options', 1;
  RECONFIGURE;
  sp_configure 'Ad Hoc Distributed Queries', 1;
  RECONFIGURE;
  GO
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>USE [master]
  GO
  
  
  EXEC master . dbo. sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0' , N'AllowInProcess' , 1
  GO
  
  EXEC master . dbo. sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0' , N'DynamicParameters' , 1
  GO
  </code></pre>
  
  <p>When I go to 'Server Objects' -> 'Linked Servers' -> 'Providers', Microsoft.ACE.OLEDB.12.0 is listed.</p>
  
  <p>Acess Database Engine x64 is installed, all Office products are 64-bit, and my SQL Server is also 64 bit.</p>
  
  <p>If it matters, all users have access to the Temp folder in the Users folder.</p>
  
  <p>(These are all suggestions I found in similar answers to this question)</p>
  
  <p>Edit: Using SQL Server 2014.</p>