在64位系统Microsoft.Jet.OLEDB.4.0错误:读取从Excel [英] Reading from Excel: Microsoft.Jet.OLEDB.4.0 error on 64 bit systems

查看:644
本文介绍了在64位系统Microsoft.Jet.OLEDB.4.0错误:读取从Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用读取Excel工作表中的内容在我的应用程序:

I am reading the contents of an excel sheet in my application using:

 OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileName + ";Extended Properties=Excel 8.0");
 _myDataSet = new DataSet();
 OleDbDataAdapter myCommand = new OleDbDataAdapter(" SELECT * FROM [" + "My Sheet" + "$]", con);

myCommand.Fill(_myDataSet);
con.Close();

这是没有在64位系统上的错误:

This is failing in 64 bit systems with the error:

Microsoft.Jet.OLEDB.4.0'提供   在本地计算机上没有注册。

Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine

如何使这项工作在64位机器?

How to make this work in 64 bit machines?

推荐答案

Microsoft.Jet.OLEDB没有64位版本中,只有32位。编译应用程序为32位(平台目标:86在构建选项)。

Microsoft.Jet.OLEDB doesn't have 64bit version, only 32bit. Compile your application as 32bit (Platform target: x86 in build option).

这篇关于在64位系统Microsoft.Jet.OLEDB.4.0错误:读取从Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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