Microsoft.ACE.OLEDB.12.0' 공급자는 로컬 컴퓨터에 등록할 수 없습니다.

라는 예외가 발생 했을 경우..

불러오려는 엑셀의 형식을 기존에 설치된 드라이버가 인식하지 못할 경우 발생하는 에러입니다.


해결방법

1. 아래의 URL에서 드라이버를 다운로드/설치하시면 문제가 해결됩니다.

   http://www.microsoft.com/ko-kr/download/details.aspx?id=13255


2. 위의 파일을 다운로드/설치를 해도 해결이 안된다면.

    해당 Project를 오른쪽 클릭 후 속성(Properties)  - Build - General - platform target을  

    변경해보시기 바랍니다.(Any CPU, X86, X64)

    (Application - Target framework 설정과 비슷한 예)

    





----------------------------------------------------------------------



출처 : http://www.sysnet.pe.kr/Default.aspx?mode=2&sub=0&pageno=1&wtype=15&wid=1036&detail=1


Access DB 에 대한 32bit/64bit OLE DB Provider 관련 오류



예를 들어, x64 운영체제에서 64비트 Office 2010 제품을 설치하고 Visual Studio 의 데이터베이스 연결 관리자에서 Access DB에 대해 연결하려고 하면 다음과 같은 오류가 발생할 수 있습니다.

access_db_error_1.png

"
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
"



오류 원인은 간단합니다. 64비트 Office 제품군을 설치하면서 64비트용 OLE DB 제공자는 시스템에 설치되었지만, 32비트 프로그램인 Visual Studio에서는 64비트용 OLE DB 제공자를 (사용할 수도 없을 뿐더러) 찾을 수 없기 때문에 발생하는 것입니다.

이를 확인하기 위해서, 해당 액세스 파일에 대해 UDL 파일을 만들고 각각 32비트/64비트 ODBC 제어판 애플릿을 구동해 보면 알 수 있습니다.

다음과 같이 64비트 용에서는 정상적으로 애플릿이 뜨지만,

"C:\Windows\system32\rundll32.exe" "C:\Program Files\Common Files\System\Ole DB\oledb32.dll",OpenDSLFile C:\temp\test.udl



32비트 용으로 실행하면 Visual Studio 에서와 비슷한 오류 화면이 뜹니다.

"C:\Windows\syswow64\rundll32.exe" "C:\Program Files (x86)\Common Files\System\Ole DB\oledb32.dll",OpenDSLFile C:\temp\test.udl



access_db_error_2.png

"
Provider cannot be found. Ensure that the provider has been installed properly.
"



물론, 이를 해결하기 위해서는 Access DB에 대한 32비트 버전의 OLE DB 제공자(aceoledb.dll)를 설치해야 하는데, Office 2007 용의 파일을 설치해도 정상적으로 동작하므로 다음의 경로에서 다운로드 받을 수 있습니다.

2007 Office System Driver: Data Connectivity Components
; http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en


참고로, 각각의 aceoledb.dll 파일경로는 다음과 같습니다.

64비트: "C:\Program Files\Common Files\Microsoft Shared\OFFICE14\ACEOLEDB.DLL"
32비트: "C:\Program Files (x86)\Common Files\microsoft shared\OFFICE12\ACEOLEDB.DLL"





만약, Office 2010 용의 파일을 설치하고 싶다면 다음의 경로에서 다운로드 받을 수 있습니다.

Microsoft Access Database Engine 2010 Redistributable 
; http://www.microsoft.com/downloads/en/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&displaylang=en


위의 경로에서 AccessDatabaseEngine.exe 파일을 다운로드 받아서 실행하는 경우, 이미 Office 2010 64비트 버전이 설치되어 있다면 오류가 발생하면서 더 이상 설치 진행이 되지 않습니다.

access_db_error_3.png

"
You cannot install the 32-bit version of Microsoft Access Database Engine 2010 because you currently have 64-bit Office products installed. If you want to install 32-bit Microsoft Access Database Engine 2010, you will first need to remove the 64-bit installation of Office products. After uninstalling the following product(s), rerun setup in order to install 32-bit version of Microsoft Access Database Engine 2010:
Microsoft Office SharePoint Designer 2010, Microsoft Office Professional Plus 2010, Microsoft Office Visio 2010
"



"Microsoft Office SharePoint Designer 2010, Microsoft Office Professional Plus 2010, Microsoft Office Visio 2010" 3가지 제품을 제거해야 한다니... 말이 안되죠. ^^;

다행히 이에 대해서는 아래의 글에서 손쉬운 해결책을 제시해 주고 있습니다.

Microsoft Access Database Engine 2010 Redistributable
; http://codefluententities.wordpress.com/2011/01/20/microsoft-access-database-engine-2010-redistributable/


즉, 명령행에서 "AccessDatabaseEngine.exe /passive" 라고 실행해 주면 되는 것입니다. 최종적으로 aceoledb.dll 의 경로는 다음과 같이 정리될 수 있습니다. ^^

64비트: "C:\Program Files\Common Files\Microsoft Shared\OFFICE14\ACEOLEDB.DLL"
32비트 2007: "C:\Program Files (x86)\Common Files\microsoft shared\OFFICE12\ACEOLEDB.DLL"
32비트 2010: "C:\Program Files (x86)\Common Files\microsoft shared\OFFICE14\ACEOLEDB.DLL"


Posted by 요지
,