使用 ODBC 连接到名称中包含句点的 MSSQL 数据库

发布于 2024-12-29 11:28:05 字数 186 浏览 2 评论 0原文

如果我有一个名为“foo4.3”的数据库,并且我尝试使用 odbc 连接到它,它会查找名为“foo4”的数据库。该句点在任何其他字符串中都可以正常工作(例如,放“foo4.3”输出“foo4.3”,所以我有点困惑为什么它试图查找名为“foo4”的数据库。我已经尝试了文字字符串版本(单引号)以及启用转义的字符串(双引号)并尝试转义句点,但我得到了相同的结果。

If I have a database named something like "foo4.3" and I attempt to connect to it using odbc it looks for a database named "foo4". The period works fine in any other string (for instance puts "foo4.3" outputs "foo4.3" so I'm a little confused as to why it is attempting to look for a database named "foo4". I've already tried the literal string version (single quotes) as well as the escape enabled string (double quotes) and attempted to escape the period but I get the same results.

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

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

发布评论

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

评论(1

戏剧牡丹亭 2025-01-05 11:28:05

将数据库名称括在括号中:[foo4.3]

Wrap the database name in brackets: [foo4.3]

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