Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
716 views
in Technique[技术] by (71.8m points)

c# - The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine in 64 Bit Machine

I am working in Windows Application. I am reading a value from Excel and updating into the database. My code is

 string Con_Str = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + filepath +
                         ";Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";";

Its working fine in my local and i am having 32 Bit Machine. I ran the exe in Server which is 64 Bit Machine. There i am getting the error like

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

I had downloaded the latest from this link..

http://www.microsoft.com/en-us/download/details.aspx?id=13255

Still i am getting the Issue. How to fix this..

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You are using Microsoft.ACE.OLEDB.12.0; (ADE for short). This means that you need to install the appropriate bits on your target machine. This is complicated by the Architecture choosen when you build your application.

You build for AnyCPU:

Install ADE 32bit on 32bit target machine
Install ADE 64bit on 64bit target machine

You build for x86

Install ADE 32bit on 32bit or 64bit target machine.

As you can see, the easiest way to get out is to compile your application for x86 architecture.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...