SQLConfigDataSource 不会为 64 位驱动程序添加系统 DSN [英] SQLConfigDataSource does not add System DSN for 64-bit drivers

查看:25
本文介绍了SQLConfigDataSource 不会为 64 位驱动程序添加系统 DSN的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 System32 加载 odbccp32.dll,甚至尝试从 SysWow64 使用.我使用 SQLConfigDataSource 函数为指定的驱动程序配置我的系统 DSN.此函数成功配置了 32 位驱动程序,但不适用于 64 位驱动程序.此 dll 是否仅适用于 32 位驱动程序?当我运行 ODBC 管理器工具(64 位)时,我能够看到 64 位驱动程序并将它们手动添加到系统 DSN,但我无法使用此 DLL 执行此操作.

I load the odbccp32.dll from System32 and even tried to use from SysWow64. I use SQLConfigDataSource function to configure my System DSN for specified Driver. This function successfully configure drivers which are 32-bit, but does not do the same for 64-bit drivers. Does this dll only works for drivers which are 32-bit? When I ran ODBC Administrator tool (64-bit) I am able to see the 64-bit drivers and add them manually to System DSN, but I cannot do this using this DLL.

推荐答案

只有 64 位应用程序可以使用 SQLConfigDataSource 配置 64 位数据源.如果您的应用程序面向 32 位 Windows,它会在调用此函数时修改 32 位数据源.您需要以不同的方式配置数据源(从 64 位应用程序、从命令行、直接修改注册表等)

Only 64-bit applications can configure a 64-bit datasource using SQLConfigDataSource. If you application is targeting 32-bit Windows, it will modify the 32-bit data sources when calling this function. You need to configure the data source in a different way (from a 64-bit application, from the command line, modify the registry directly, etc.)

这篇关于SQLConfigDataSource 不会为 64 位驱动程序添加系统 DSN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆