提取 ODBC 数据源信息

发布于 2024-08-25 04:16:52 字数 285 浏览 0 评论 0原文

我已经通过 ODBC API 搜索可以提取数据源信息的函数。我发现的最接近的是 SQLDataSources ,它枚举了所有数据源并为您提供 DSN 名称/描述。

但具体来说,我想提取 Oracle 数据源的 TNS 服务名称。此属性出现在注册表中的 ServerName 下,但我发现无法通过 API 访问它。

I've gone through ODBC API searching for a function that can extract information of a data source. The closest I found is SQLDataSources that enumerates all data sources and gives you the DSN name/description.

But specifically I would to extract the TNS service name of an Oracle data source. This property appears in the registry under ServerName but I found no way to access it through an API.

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

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

发布评论

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

评论(1

怂人 2024-09-01 04:16:52

通常使用的 SQLGetPrivateProfileString 函数由 ODBC 管理员读取此类信息可能是最好的选择,因为这与操作系统无关,并且由大多数 ODBC 驱动程序管理器在非 Windows 平台上实现,例如 iODBCUnixODBC 等。

The SQLGetPrivateProfileString function, which is typically used by the ODBC Administrator for reading such information is probably the best one to use, as this would be OS independent and implemented by most ODBC Driver Managers on none windows platforms, like iODBC, UnixODBC etc.

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