title: How to find out the reason for OLE provider permission on SQL Server?
body: <p>I installed Office 2010 64 bit on Windows 7 64 bit. There is a SQL Server 2008 installed on windows 7 too. </p>
  
  <p>Then I try to use <code>Microsoft.ACE.OLEDB.12.0</code> to access data from excel file with T-SQL. </p>
  
  <p>I try T-SQL in SQL Server Mgmt Studio with following kind of query:</p>
  
  <pre><code>SELECT *
  FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;Database=C:\Temp\book1.xlsx;', 'SELECT * FROM [Sheet1$]')
  </code></pre>
  
  <p>If I start SQL Server Mgmt Studio with 'Run as Administrator', it is okay. I can access/insert data from/to the Excel file. </p>
  
  <p>If I start Mgmt Studio directly (with my AD account), I will get error like:</p>
  
  <blockquote>
    <p>OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "Unspecified error".<br>
    Msg 7303, Level 16, State 1, Line 1<br>
    Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".</p>
  </blockquote>
  
  <p>but actually, my account is also a admin account (it is in Local Administrator group and AD admin group). </p>
  
  <p>Because I need to run T-SQL like <code>OpenRowSet</code> in code, not sure how to resolve this issue.</p>
  
  <p>Looks like OpenRowSet for this case only okay for local administrator to run MSSM. </p>
  
  <p>I try to run MSSM from another computer, and got same error as above. </p>