I am using the below script and got the following error:
Cannot create an instance of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
EXEC SP_CONFIGURE 'show advanced options', 1;
GO
RECONFIGURE;
EXEC SP_CONFIGURE 'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE;
INSERT INTO OPENROWSET ('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;Database=c:\CSV\testing.xlsx;',
'SELECT * FROM [Sheet1$]')
select top 10 * from Emp2
How can I fix this? I need to export data to Excel file in UNC path. Please guide me how to achieve it.
Again I try the below script too but this time I am getting a different error:
Cannot create an instance of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".
EXEC sp_configure 'show advanced options', 1
RECONFIGURE
GO
EXEC sp_configure 'ad hoc distributed queries', 1
RECONFIGURE
GO
INSERT INTO OPENROWSET
('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=c:\CSV\testing.xlsx;','SELECT ID,Name FROM [Sheet1$]')
select top 10 * from Emp2
Please guide me how to export data to an Excel file which will be generated in UNC path.