0

I have some issue when executing scripts in SQL.

SELECT * 
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
 'Excel 8.0;Database=D:\Application\myExcel.xls;', 
        'SELECT * FROM [Sheet1$]') 

When I login to SQL Server with Windows authentication, the script above runs successfully.

But when I login to SQL Server with SQL Server authentication (not sa account), the script throw this error:

Msg 7399, Level 16, State 1, Line 8
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 8
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".

Could anyone please tell me why and how to fix it?

I'm using SQL Server 2012 (x64), Windows Server 2012 R2.

Thank you very much.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
hai tuan
  • 3
  • 1
  • What does this have to do with VB.NET? – Thorsten Dittmar Dec 02 '16 at 08:09
  • This is a duplicated question. http://stackoverflow.com/questions/26267224/the-ole-db-provider-microsoft-ace-oledb-12-0-for-linked-server-null http://stackoverflow.com/questions/15822576/excel-into-sql-server-with-microsoft-ace-oledb-12-0 – McNets Dec 02 '16 at 08:37
  • I guess the accounts have different permissions. Googling around it seems that you can use `SELECT * FROM fn_my_permissions(NULL, 'DATABASE') ` to list permissions for each account – Nick.Mc Dec 02 '16 at 09:47

0 Answers0