Andrew Pankov (3/2/2015)
Hi Jeff, thank you for response.I tried OPENDATASOURCE instead of OPENROWSET.
SELECT * FROM OPENDATASOURCE ('Microsoft.ACE.OLEDB.12.0', 'Data Source=\\server\share\filename.xls;Extended Properties="Excel 12.0;IMEX=1;HDR=NO;"')...['2014$']
It's running ok again when sql server is connected in SSMS under [sa], but under his windows account it returns an error:
Msg 7302, Level 16, State 1, Line 1
Cannot create an instance of OLE DB provider "MSDASC" for linked server "(null)".
User is MYDOMAIN\JDoe is a member of AD group MYDOMAIN\SQL_developers that is a member of [sysadmin] sqlserver role.
MYDOMAIN\JDoe also has a maximal access to the share where xls file is located, via the group MYDOMAIN\SQL_developers.
It's all working under my AD account that is a domain admin
It's all working under 'sa'
What the difference if sql is connected under "sa" or account that is a member of "sysadmin" role?
Turn it into a stored procedure that contains "EXECUTE AS OWNER" and give the user privs to run the stored procedure. Do NOT give the user "SA" or other special privs.
{edit}.... and make sure that you check any path inputs for DOS Injection as well as SQL Injection.
--Jeff Moden
Change is inevitable... Change for the better is not.