Microsoft Jet 数据库引擎找不到对象'Sheet1$_'。请确定对象是否存在,并正确地写出它的名称和路径
Once we had an issue with one of our customers complaining of the data successfully being imported, yet an error message is displayed 'Sheet1$'_ not found. What was intriguing was the error could only be replicated with the sheet that are customer had provided us. If we were to create a new Excel workbook and provide it for import, we would receive no errors :( It was a classic example of "it works on my machine...")
After researching into this issue further, we found the reason.
The tool used the following line of code to read all sheets from the workbook
dtTables = objExcelConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
This returned 2 data tables, one with the name 'Sheet1$' and the other named 'Sheet1$'_.
the first sheet 'Sheet1$' is the normal naming convention when you read an excel workbook. But where did the second sheet 'Sheet1$'_ come from?? If you open the excel workbook, you will find only one sheet in the workbook named 'Sheet1'.
The second sheet 'Sheet1$'_ is a hidden sheet that Excel creates each time you filter the records on a sheet. It will create a hidden copy of the sheet. This is the sheet that the program tries to read through the code.
To fix this problem we added the following code to catch such sheets
if(SheetName.EndsWith("_"))
{
do nothing;
}
else
{
do operation
}
Microsoft Jet 数据库引擎找不到对象'Sheet1$_'。请确定对象是否存在,并正确地写出它的名称和路径的更多相关文章
- C# 解决读取dbf文件,提示Microsoft Jet 数据库引擎找不到对象的问题
前言 最新项目需要经常和dbf文件打交道,在实际场景中很多软件需要和一些老的系统进行数据交互,而这些系统都在使用foxpro数据库,读取dbf文件一般都是分为两种情况:第一:安装foxpro的驱动进行 ...
- C# - Excel - Microsoft Access 数据库引擎找不到对象
我几乎要无语了,疯掉了,以为是office本身的问题,换了好多次office2007,安装又不顺利,换到了office2010,想想大部分应该兼容2007,所以用着office2010了. 甚至差点要 ...
- Microsoft Jet 数据库引擎打不开文件,它已经被别的用户以独占方式打开,或没有查看数据的权限。
System.Data.OleDb.OleDbException (0x80004005): Microsoft Jet 数据库引擎打不开文件'D:\wwwroot\gonghouxie\wwwroo ...
- Microsoft Jet 数据库引擎 SQL 和 ANSI SQL 的比较
http://westlife063.blog.163.com/blog/static/129942096201052591210384/ Microsoft Jet 数据库引擎 SQL 和 AN ...
- Err.number错误号和可捕获的 Microsoft access 数据库引擎和 DAO错误说明
错误码 信息2420 数字语法错误2421 日期语法错误2422 字符串语法错误2423 ‘.’.‘!’.或 ‘()’的使用无效2 ...
- IIS发布网站Microsoft JET Database Engine 错误 '80004005'的解决办法,基于Access数据库
在网站发布后,访问网站会有80004005的错误提示. 项目环境 项目基于Access数据库,server2012,文件系统为NTFS格式. 错误信息 Microsoft JETDatabase En ...
- sqlserver安装出现找不到数据库引擎错误
sqlserver安装出现找不到数据库引擎错误 问题的解决 第一次安装SQL server,发现它较于Oracle,都有安装卸载十分麻烦的特点.刚开始安装,就让我频繁遇到这个“找不到数据库引擎”的错误 ...
- Microsoft.Jet.OLEDB.4.0和Microsoft.ACE.OLEDB.12.0的区别
Microsoft.Jet.OLEDB.4.0和Microsoft.ACE.OLEDB.12.0的区别 时间 2012-12-19 20:30:12 CSDN博客原文 http://blog.cs ...
- c# 程序调试出现“未在本地计算机上注册“Microsoft.Jet.OLEDB.4.0”提供程序。”
简单的程序代码如下:DataSet ds=new DataSet();try{ string strCon = @"Provider=Microsoft.Jet.OLEDB.4.0;Data ...
随机推荐
- poj 1684 Lazy Math Instructor(字符串)
题目链接:http://poj.org/problem?id=1686 思路分析:该问题为表达式求值问题,对于字母使用浮点数替换即可,因为输入中的数字只能是单个digit. 代码如下: #includ ...
- c#观察者模式学习笔记(1)
c#中的观察者是一种逻辑上很重要的角色,在服务端,观察者是服务端的通讯员,它将事件与业务紧密的结合,彼此又能按照逻辑进行分离. 实现方法为: (1)声明事件的委托原型,作为事件订阅的回调. (2)使用 ...
- Html 语法学习笔记二
1.图像标签(<img>)和源属性(Src) 在 HTML 中.图像由 <img> 标签定义. <img> 是空标签,意思是说,它仅仅包括属性,而且没 ...
- xcode initWithCoder\awakeFromNib\layoutSubviews
控件通过xib,storyboard创建,初始化设置一定会调用initWithCoder awakeFromNib 加载完毕的时候肯定会调用 layoutSubviews 布局子控件 位置和尺寸 利用 ...
- BootStrap 智能表单系列 六 表单数据绑定(编辑页面的数据绑定)
本章介绍如何在生成表单后,将一个model的数据展示到form表单中(一般用于编辑页面) 代码如下(连接地址:https://github.com/xiexingen/Bootstrap-SmartF ...
- (转)原子操作 Interlocked系列函数
上一篇<多线程第一次亲密接触 CreateThread与_beginthreadex本质区别>中讲到一个多线程报数功能.为了描述方便和代码简洁起见,我们可以只输出最后的报数结果来观察程序是 ...
- 搜索(BFS)
Problem B: Fire! Joe works in a maze. Unfortunately, portions of the maze have caught on fire, and t ...
- BZOJ 1834: [ZJOI2010]network 网络扩容(最大流+最小费用最大流)
第一问直接跑最大流.然后将所有边再加一次,费用为扩容费用,容量为k,再从一个超级源点连一条容量为k,费用为0的边到原源点,从原汇点连一条同样的边到超级汇点,然 后跑最小费用最大流就OK了. ---- ...
- RUP(Rational Unified Process)笔记整理
RUP,统一软件开发过程是一种面向对象且基于网络的程序开发方法论. RUP的思路:Implementing BestPractices ·迭代式开发 在软件开发的早期阶段就想完全.准确的捕获用户的需求 ...
- C part 1 -- 指令篇
Windows系统的cmd(command命令行工具): Shutdown -s -t 600:表示600秒后自动关机 Shutdown -a :可取消定时关机 Shutdown -r -t 600: ...