'Microsoft.ACE.OLEDB.12.0' provider is not

2018-12-31 02:48发布

I'm trying to get data from an Excel file on a button click event. My connection string is:

 string connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\source\\SiteCore65\\Individual-Data.xls;Extended Properties=Excel 8.0;";

When I click on the button, I got the following error:

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

I have no clue how to fix this. My operating system is Windows 7.

30条回答
琉璃瓶的回忆
2楼-- · 2018-12-31 03:31

If you get this error when trying to use ACE from an ASP.NET application, the most likely cause is that you have installed either one of the 32-bit versions. By default, IIS on a 64-bit operating system will run applications in a 64-bit worker process. 64-bit processes cannot load 32-bit DLLs. When a call is made to the ACE provider, the 64 bit process will attempt to locate a 64-bit DLL. If it doesn't exist, you get the error message that brought you here.

In this case you have two options. First, you can install the 2010 64-bit version. If you have the 2007 32-bit version installed, you can simply install the 2010 64-bit version alongside it. If you have the 32-bit version of 2010 installed, you need to uninstall it and download and install the 64-bit 2010 version instead. You cannot have both the 32- and 64-bit versions of the 2010 provider installed at the same time. If you are performing the installation on your development machine, you may also be constrained by the bit-ness of any existing Office installations.

The second option is to change the application pool in IIS to enable 32-bit applications. If you are using the full version of IIS, you can use the management tool to do this (Control Panel » Administrative Tools » Internet Information Services (IIS) Manager).

For more understanding please refer below link

查看更多
何处买醉
3楼-- · 2018-12-31 03:31

I faced this same problem. Go to the Solution Properties and change Any CPU to x86, I think it will do the job.

查看更多
浮光初槿花落
4楼-- · 2018-12-31 03:33

I had this issue when attempting to import data from an excel file (xlsx) into a SQL Server DB using SSMS 2014.

The 2007 Office System Driver: Data Connectivity Components install did the trick for me.

查看更多
深知你不懂我心
5楼-- · 2018-12-31 03:33

This worked for me right now.

  1. Visit this page then download that appropriated package for your computer (AccessDatabaseEngine.exe or AccessDatabaseEngine_X64.exe)
  2. Install that.
  3. Enjoye... Your codes is work now...

But for your application package you can use of any the following solutions:

  1. Go in "C:\Program Files (x86)\Common Files\microsoft shared" or "C:\Program Files\Common Files\Microsoft Shared" and put the "OFFICE14" directory in the same location of your package file.

Or

  1. Attach two projects (in item1) in your installation package.
查看更多
与风俱净
6楼-- · 2018-12-31 03:34

Well, you need to install it. You're looking for:

查看更多
不再属于我。
7楼-- · 2018-12-31 03:34

I received this error when importing data from an Excel file into MS-SQL. The provider was already installed (64-bit) and this surprised me why it didn't work. So all I did was locate the Import/Export application used here i.e. the .EXE. And I found it at

C:\Program Files\Microsoft SQL Server\130\DTS\Binn\DTSWizard.exe

I then ran the .exe directly to perform the data import. And it worked!

查看更多
登录 后发表回答