SQLConfigDataSource不会为64位驱动程序添加System DSN [英] SQLConfigDataSource does not add System DSN for 64-bit drivers
问题描述
我从System32
加载odbccp32.dll,甚至尝试从SysWow64
使用.我使用SQLConfigDataSource
函数为指定的驱动程序配置我的系统DSN.此功能可以成功配置32位驱动程序,但对于64位驱动程序则不能.此dll
仅适用于32位驱动程序吗?当我运行ODBC管理器工具(64位)时,能够看到64位驱动程序并将其手动添加到System 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位驱动程序添加System DSN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!