打开扩展名为xlsx的时候报错,但是扩展名为xls的时候就可以正常使用
2015-09-19 22:54
274 查看
驱动Microsoft.ACE.OLEDB.12.0,能够成功的创建 xlsx 文件,但是用 Excel 打开的时候,会提示错误信息。
我们将驱动修改为:
constring = "Provider=Microsoft.ACE.OLEDB.12.0;"
+ "Data Source=" + txtFilePath.Text.Trim() + ";"
+ "Extended Properties=Excel 12.0";
注意
修改的地方"Extended Properties=Excel 12.0;
与以前的 Extended Properties=Excel 8.0;
当扩展名为xlsx的时候必须使用Extended Properties=Excel 12.0驱动的写法。当扩展名为xls的时候使用哪个都可以
我们将驱动修改为:
constring = "Provider=Microsoft.ACE.OLEDB.12.0;"
+ "Data Source=" + txtFilePath.Text.Trim() + ";"
+ "Extended Properties=Excel 12.0";
注意
修改的地方"Extended Properties=Excel 12.0;
与以前的 Extended Properties=Excel 8.0;
当扩展名为xlsx的时候必须使用Extended Properties=Excel 12.0驱动的写法。当扩展名为xls的时候使用哪个都可以
相关文章推荐
- linux进程通信--信号量
- Android Api Demos登顶之路(七十五)Graphics-->GradientDrawable
- hdu 5455 Fang Fang 坑题
- git 的认识
- HDU 5452 Minimum Cut
- 新浪、万网前系统架构师高俊峰:统一监控报警平台架构设计思路
- 读写分离之Amoeba
- 简洁调用字号
- 安倍强行通过安保法案带来三大祸害
- codevs 1046 旅行家的预算
- 软工视频(前三章)
- hdu3499 分层图
- 再读大道至简第一章以及生活有感
- Mac OS系统上用命令行方式启动VNC Server
- 第一次博客
- 我的首篇CSDN博客
- 点击UICollectionViewCell上的UIButton如何获取当前的UICollectionViewCell?
- 仿射空间(affine space),仿射组合(affine combination)
- 十六进制颜色宏
- json对象和json字符串有啥区别啊