Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I am executing following query but its giving an error saying that "
The OLE DB provider "Microsoft.ACE.OLEDB.12.0" has not been registered.
"
VB
SELECT
  * FROM
  OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;Database=D:\New\Albany_ActPlan_2008_1Record.xlsx;HDR=YES;IMEX=1',
  'SELECT * FROM [Albany_ActPlan_2008_1Record]') AS POND;



could any one help me out to resolve this problem.

Thanks and Regards
prakash.ch
Posted
Updated 17-Apr-19 1:01am
Comments
maneavnash 9-Jul-13 5:39am    
check whether u add this Microsoft.ACE.OLEDB.12.0.dll in project or not.
by add references
prakash.chakrala 9-Jul-13 5:48am    
Hiafter adding reference am getting another error saying that "OLE DB provider 'Microsoft.ACE.OLEDB.12.0' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode."
Maciej Los 9-Jul-13 17:27pm    
We need more details: Windows and SQL Server version. In both cases with information about is it 32 or 64 bit version.

Information I found in this posting on MSDN helped me solve this problem:
HOW TO: FIX ERROR - "the 'microsoft.ace.oledb.12.0' provider is not registered on the local machine"[^]
 
Share this answer
 
Comments
prakash.chakrala 10-Jul-13 2:25am    
Hi now am getting following error

OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "Unspecified error".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".
Check this will work

EXEC sp_addlinkedserver
@server = 'Server1',
@srvproduct = 'Excel',
@provider = 'Microsoft.ACE.OLEDB.14.0',
@datasrc = 'D:\New\Albany_ActPlan_2008_1Record.xlsx;HDR=YES;IMEX=1',
@provstr = 'Excel 14.0;IMEX=1;HDR=YES;'

SELECT * FROM Server1...TableName
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900