I'm trying to run an OPENROWSET query to an Excel sheet like so:
SELECT id, SourceName
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0; HDR=YES; IMEX=1; Database=D:\MyFolder\Configuration.xlsx', 'SELECT * FROM [Sheet1$]')
When I execute this from SSMS it works. As part of a job step, it doesn't work with the error stated.
Things I've tried:
sp_configure 'show advanced options', 1; RECONFIGURE; GO sp_configure 'Ad Hoc Distributed Queries', 1; RECONFIGURE; 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
Setting the permissions on the target spreadsheet & folders to 'Everyone' and 'Read/Write'
When I go to 'Server Objects' -> 'Linked Servers' -> 'Providers', Microsoft.ACE.OLEDB.12.0 is listed and it's in xp_enum_oledb_providers.
Access Database Engine x64 is installed.
This is SQL Server 2014.
Can anyone help? Why would the SQL Server Agent be unable to use the ACE provider when my user can?