OleDb 连接字符串中扩展属性的规范?
目前,我正在搜索连接字符串的属性,该属性可用于以只读模式连接到 Excel 文件。搜索 Google 为我提供了很多连接字符串的示例,但我似乎无法在 OleDb 连接字符串的“扩展属性”部分中找到所有可能性的规范。
目前我有这个:
Provider = Microsoft.Jet.OLEDB.4.0; Data Source = D:\Data\Customers.xls; Extended Properties = 'Excel 8.0; Mode=Read; ReadOnly=true; HDR=Yes';
但是......我已经通过示例编写了这个。所以问题: 1. OleDb 连接字符串文档/参考的合适来源是什么? 2. 上述连接字符串是否确实以只读模式连接到Excel文件?
谢谢!
At the moment I'm searching for properties for a connection string, which can be used to connect to an Excel file in readonly mode. Searching Google gets me a lot of examples of connection strings, but I can't seem to find a specification of all possibilities in the 'Extended Properties' section of the OleDb connection string.
At the moment I've this:
Provider = Microsoft.Jet.OLEDB.4.0; Data Source = D:\Data\Customers.xls; Extended Properties = 'Excel 8.0; Mode=Read; ReadOnly=true; HDR=Yes';
However... I've composed this by examples. So questions:
1. What is a decent source for OleDb Connection String documentation/reference?
2. Is the above connection string indeed connecting to the Excel file in readonly mode?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我正在使用 UDL 文件。
接下来做:
然后保存并在文本编辑器中打开文件,您将看到连接字符串
您也可以查看 msdn 文章 ADO 提供程序属性和设置
I am using UDL file for that.
Do next:
Than save, and open file in text editor and you will see connection string
As well you can check msdn article ADO Provider Properties and Settings
对 Excel 规范的基于 COM 的数据访问可能隐藏在几乎无法访问的 Microsoft 存档文档中。 (通常作为一个巨大的 PDF)
我将规范添加到此处的另一个答案: https://stackoverflow.com/a/68912543/6237912 :
为了完整性,复制到这个答案
COM-based data access to Excel specifications are likely buried in nearly inaccessible Microsoft archive documentation. (Usually served as one enormous PDF)
I added the spec to another answer here: https://stackoverflow.com/a/68912543/6237912
Copied to this answer for completeness: