提供 URI 作为 ODBC 或 OleDB 提供程序连接字符串的参数吗?

发布于 2024-08-24 15:37:55 字数 221 浏览 1 评论 0原文

有没有办法将 URI(而不是物理路径)指定为 OleDB 连接字符串中的“Data Source”参数,或指定为 OleDB 连接字符串中的“Dbq”参数ODBC 连接字符串,以便默认的 ADO.Net 提供程序可以使用它?

我已经尝试过 file://,但不行,所以我只是想确认这是否可行。我猜不是,但任何确认或文档链接将不胜感激。

Is there any way of specifying a URI (rather than a physical path) as the "Data Source" parameter in an OleDB connection string, or the "Dbq" parameter in an ODBC connection string, such that the default ADO.Net providers will work with it?

I've tried file://, and it's a no go, so I just wanted to confirm whether or not this is possible. I'm guessing not, but any confirmation or documentation links would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

弃爱 2024-08-31 15:37:55

我很可能误解了这个问题,但我相信除非特定的提供商允许该功能,否则不可能执行您所要求的操作。我编写了 ODBC 驱动程序、OLE DB 提供程序和 ADO.NET 数据提供程序的部分内容。在所有情况下,我的经验是数据源值直接传递到底层提供程序/驱动程序,无需任何转换。事实上,在许多情况下,从应用程序到提供程序本身的调用几乎是直接调用,无需任何附加层(例如,SqlConnection myconn = new SqlConnection( connstring ); 不经过任何中间层甚至有机会对连接字符串执行任何操作,因此如果提供者无法将 URI 识别为有效的数据源,那么这将是一个错误,

因此据我所知,问题在于规范是否正确 。要求提供商/驱动程序开发人员识别 URI。我已经阅读了很多这些技术的规范,并且不记得看到过任何需要此类支持的规范,那么我还有一些工作要做:)

It's quite possible that I misunderstand the question, but I believe that it is not possible to do what you are asking unless the specific provider allows for that functionality. I have written parts of an ODBC driver, OLE DB provider, and an ADO.NET data provider. In all cases, my experience has been that the Data Source value is passed directly to the underlying provider/driver without any translation. In fact, in many cases the call from the application to the provider itself is pretty much a direct call without any additional layers (e.g., SqlConnection myconn = new SqlConnection( connstring ); doesn't go through any middle layer that would even have the opportunity of doing anything with the connection string. So if the provider did not recognize the URI as a valid data source, it would be an error.

So the issue as I understand it is whether or not the specification requires provider/driver developers to recognize URIs. I have read the specs quite a bit for those technologies and do not recall seeing anything that required such support. If such a specification exists, then I have some work to do :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文