Monday, January 30, 2012

The OLE DB provider "Microsoft.ACE.OLEDB.12.0" has not been registered


If you run below SQL statement
---------------------------------------------------------
Select * into DBTable FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;Database=D:\myExcelFile.xlsx;HDR=YES', 'SELECT * FROM [Sheet1$]')




INSERT INTO DBTable select * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;Database=D:\myExcelFile.xlsx;HDR=YES', 'SELECT * FROM [Sheet1$]')
--------------------------------------------------------


and you get an error message like below
The OLE DB provider "Microsoft.ACE.OLEDB.12.0" has not been registered


Solution
you need to download 
"Data Connectivity Components for 2007 office system Driver".
after you download, please restart your server.


you can click link here to download from microsoft site.


you will able to saw your microsoft excel driver 12.0 in your Data Sources(ODBC) in control panel