Reading Netezza database table from C# via ODBC not working in Windows 7

百般思念 提交于 2019-11-30 10:36:44

Microsoft never renamed their "system32" folder, so system32 really has all of the 64 bit drivers. And SysWow64 folder has all of the 32 bit drivers. By default, a .NET project created in Visual Studio 2010 will have a "Target Platform" of x86. I just changed it to x64 and my connection worked to get my 64 bit NetezzaSQL driver working for .NET.

Just realize that you can launch the ODBC (Data Sources) dialog under Control Panel > Administrative Tools by running the "odbcad32.exe" file in either the C:\Windows\system32\ folder (this is the 64 bit version of the dialog to build 64 bit drivers), or in the C:\Windows\SysWow64\ folder (this is the 32 bit/x86 version of the dialog to build 32 bit drivers). Yes, the folders are reversed because Microsoft is weird that way.

Furthermore, there are two different folders in the Registry that get built. Turns out that the list above (in my black screen shot) comes from the Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ list because those are 32 bit drivers. The dll I installed, "nzodbcsetup.exe", apparently installed as a 64 bit driver. I am not exactly sure how to install this as a 32 bit driver on 64 bit windows, so that's why I changed the "Target Platform" in my .NET project from the default x86 to x64. There has to be a way to install it as a 32 bit driver as well because when I installed this on a 32 bit Windows XP box, the driver worked fine.

What's weird is that Netezza's OLE drivers are separated. They have a 32 bit and a 64 bit dll exe file (for version 6.0.3). "nzoledbsetup.exe" (~82MB x86) and "nzoledbsetup64.exe" (~102MB x64). But the ODBC just has one, which is apparently both. I tried manually building a 32 bit driver in the SysWOW6432Node (under run > regedit) and pointed to the Driver file and Setup file (in the system32 folder, but I got an error. Please comment is there a way in Windows to automatically install as 32 bit, not 64.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!