I'm developing an application where I need to import data from Excel to an MS SQL Server database. I've installed Microsoft Access Database Engine 2010 Redistributable on the MS SQL Server machine as well as on my machine
Configured the MS SQL Server like this:
USE [master]
GO
sp_configure 'show advanced options', 1
GO
RECONFIGURE WITH OverRide
GO
sp_configure 'Ad Hoc Distributed Queries', 1
GO
RECONFIGURE WITH OverRide
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
In my application I'm using:
SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;Database=PathToMyExcelDoc', [Devices$])
When the application and SQL Server are on the same machine, it works fine, but when I'm running the application on my machine and try to import data from Excel to a remote SQL Server, I get the following error:
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.
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".