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 ...
随机推荐
- react-native 入门资源合集
# 了解react-native React Native enables you to build world-class application experiences on native pla ...
- python邮件发送脚本
转自:http://phinecos.cnblogs.com/ #!/usr/bin/python #coding=utf-8 #@author:dengyike #@date:2010-09-28 ...
- 新浪微博 2.4sdk 一闪而过
解决方法,保持 ios应用中的 build id和 开放平台中填写的一致
- [SAP] 外部系统调用SAP web service用户验证的简单方法
场景: 一个Java系统调用SAP系统提供的web service,除了根据WSDL生成的代理类,调用相应方法,传入相应参数外,还等需要使用SAP提供的用户信息进行身份验证,最简单的方法是在soap请 ...
- iOS实战(零):开发社区、文档等资源
社区 Apple官方资源 Xcode文档库: Window->Documentation and API Reference (可以在xcode的Preferences中下载最新的文档) iOS ...
- centos7安装mysql5.6
1.更新yum源 wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm rpm -ivh mysql-communit ...
- VS2010使用DX报错 VS报错之混合模式程序集是针对“v1.1.4322”版的运行时生成的,在没有配置其他信息的情况下,无法在 4.0 运行时中加载该程序集。
更改项目的app.config内容为以下内容 目的是开启对低版本的NETFWK支持 其实出现混合模式集的问题不只是在V1.1.4322这个版本上,在查询解决方案时发现,但凡程序集版本发生改变时,都有可 ...
- 运用DIV拖拽实现resize和碰撞检测
运用DIV拖拽实现resize和碰撞检测 Div由拖拽改变大小 演示demo 当我们运用html元素"textarea"写一个文本输入框时,浏览器会自动生成以下样式 用鼠标拖动右下 ...
- bzoj 1295: [SCOI2009]最长距离
题目链接 1295: [SCOI2009]最长距离 Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 1165 Solved: 619[Submit][ ...
- 深究带PLL的错误复位设计
PLL复位通常犯的错误 或者是像上一篇文章 FPGA知识大梳理(四)FPGA中的复位系统大汇总 中的图一样,也是错误设计.为何呢?看ALTPLL (Phase-Locked Loop) IP Cor ...