是否可以查询 OleDB 连接以确定是否必须使用方括号或引号?

发布于 2024-08-15 05:39:23 字数 264 浏览 3 评论 0原文

是否可以查询 OleDB 连接以确定是否必须使用方括号或引号?

SQL:

SELECT [FullName] From [My Users]

Oracle

SELECT "FullName" From "My Users"

MySQL:

SELECT `FullName` From `My Users`

Is it possible to query an OleDB connection to find out if you must use square brackets or quotes?

SQL:

SELECT [FullName] From [My Users]

Oracle

SELECT "FullName" From "My Users"

MySQL:

SELECT `FullName` From `My Users`

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

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

发布评论

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

评论(2

放飞的风筝 2024-08-22 05:39:23

OLE DB 本身具有带 GetLiteralInfo 方法的 IDBInfo 接口。其中的几条信息是 DBLITERAL_QUOTE_PREFIX 和 DBLITERAL_QUOTE_SUFFIX,这是您正在查找的信息。如果您使用的提供程序公开了该接口,那么您应该能够通过 OpenSchema 方法通过 ADO 访问它。 SchemaEnum 包含 adSchemaDBInfoLiterals,它应返回包含所需信息的 Recordset 。

OLE DB itself has the IDBInfo interface with the GetLiteralInfo method. A couple of the pieces of information in it are DBLITERAL_QUOTE_PREFIX and DBLITERAL_QUOTE_SUFFIX, which is the information you are looking for. If the provider you are using exposes that interface, then you should be able to access it through ADO via the OpenSchema method. The SchemaEnum contains adSchemaDBInfoLiterals, which should return a Recordset with the desired information.

云之铃。 2024-08-22 05:39:23

我不知道这是否可能,但我确实知道.Net 中的 OleDb Connection 对象有一个名为 Provider 它将告诉您要连接到哪种数据库。

I don't know if this is possible or not, but I do know that the OleDb Connection object in .Net has a property called Provider that will tell you what kind of database you are connecting to.

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