连接字符串和 ISAM 的问题
我有以下问题。很少有应用程序从 Excel 文件中读取一些数据。这是我的连接字符串:
@"Provider=Microsoft.ACE.OLEDB.12.0;"+
@"Data Source=" + m_excelFileName + ";" +
@"Extended Properties=Excel 12.0;"
当我使用它时,一切都运行良好,但 Excel 文件中第一行的数据被读取为列名。我不想要它,所以我必须更改我的连接字符串并添加以下内容:
@"Provider=Microsoft.ACE.OLEDB.12.0;"+
@"Data Source=" + m_excelFileName + ";" +
@"Extended Properties=Excel 12.0;"+
@"HDR=NO;";
我不知道为什么,但我的阅读功能不起作用,我已经传达了:
Could not find installable ISAM
出了什么问题? 感谢您的任何建议。
I have the following problem. Have little application which read some data from excel file. Here is my connection string:
@"Provider=Microsoft.ACE.OLEDB.12.0;"+
@"Data Source=" + m_excelFileName + ";" +
@"Extended Properties=Excel 12.0;"
When I use it everything is working great but data from first rows in my excel file is read as column name. I don't want it so I must change my connection string and add this:
@"Provider=Microsoft.ACE.OLEDB.12.0;"+
@"Data Source=" + m_excelFileName + ";" +
@"Extended Properties=Excel 12.0;"+
@"HDR=NO;";
I don't know why but then my reading function doesn't work and i have communicate that:
Could not find installable ISAM
What's going wrong?
Thanks for any advise.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
来自Microsoft 支持:
支持pilotcam的回答。
祝你好运!
From Microsoft support:
Support pilotcam's answer.
Good luck!
尝试将扩展属性放在引号中...
并删除“@”,因为您需要转义引号
Try surrounding the extended properties in quotes...
and remove the "@" since you need to escape the quotes
不知道我理解得好不好。我尝试了 piloctam 的代码,但有些东西不太好。
有些引用不好。
也许一句话:
可以吗?
I don't know if I understanding well. I try piloctam's code but something is not good.
Some quotes is not good.
Maybe in one line:
That is ok?