我得到一个错误'Microsoft.Jet.OLEDB.4.0'提供程序未在本地计算机上注册。 [英] Im Getting an Error 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.

查看:78
本文介绍了我得到一个错误'Microsoft.Jet.OLEDB.4.0'提供程序未在本地计算机上注册。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在ASP.net应用程序的某个我的报告页面中将Excel文件转换为CSV格式。

并为此使用以下代码



  var  cnnStr = < span class =code-sdkkeyword> String  .Format(  Provider = Microsoft.Jet.OLEDB。 4.0;数据源= {0};扩展属性= \Excel 8.0; IMEX = 1; HDR = NO \,excelFilePath); 
var cnn = new OleDbConnection(cnnStr);







在我的机器上工作我在我的系统上安装了MS OFFICE 2013,当我在SERVER上发布相同的代码时,我得到了错误'Microsoft .Jet.OLEDB.4.0'提供商未在本地计算机上注册。



服务器没有安装MS office但它有

Microsoft Access数据库引擎2010

Microsoft Access数据库引擎2007

Microsoft Access Runtime 2007



请帮助

解决方案

试试这个 -

1.右键点击项目

2.点击属性

3.转到构建标签

4.确保平台目标设置为< b> x86



正如@digimanus在评论中提到的,没有64位版本的Jet。如果你的项目是CPU(x64)特定的,那么尝试使用ACE 64位驱动程序。



希望,它有帮助:)


您可以将Microsoft.ACE.OLEDB.12.0用于64位系统。您可以检查它是32位还是64位系统。如果32位然后使用.JET.OLEDB,则使用ACE.OLEDB。



您可以查看以下链接以下载AccessDatabaseEngine

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

Hi,

I'm Converting an Excel File to CSV in one of My Report Page in an ASP.net application.
and for that im using following code

var cnnStr = String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=\"Excel 8.0;IMEX=1;HDR=NO\"", excelFilePath);
          var cnn = new OleDbConnection(cnnStr);




its working on my machine I have MS OFFICE 2013 on my system when i publish the same code on SERVER it gets me the error 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.

Server doesn't have MS office Installed but it has
Microsoft Access Database Engine 2010
Microsoft Access database Engine 2007
Microsoft Access Runtime 2007

Please Help

解决方案

Try this-
1. Right click on the project
2. Click Properties
3. Go to Build tab
4. Make sure that Platform Target is set to x86

As @digimanus has mentioned in comment, there is no 64 bit version of Jet. If your project is CPU (x64) specific then try using ACE 64 bit driver.

Hope, it helps :)


You can use Microsoft.ACE.OLEDB.12.0 for 64 bit system. You can check is it 32 bit or 64 bit system. If 32 bit then use .JET.OLEDB else use ACE.OLEDB.

You can check following link for downloading AccessDatabaseEngine
http://www.microsoft.com/download/en/details.aspx?id=13255


这篇关于我得到一个错误'Microsoft.Jet.OLEDB.4.0'提供程序未在本地计算机上注册。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆