Wednesday, 11 May 2011

Confusion with ODBC and 64 bit deployment server

The start of my confusion is how JDE is working.  I’ve changed all of the ODBC’s as I traditionally would for a new enterprise server.  This is exporting the reg file, changing the server name and importing the reg file – simple…

But, although the registry is updated, when I check the ODBC control panel – its not updated.  Also, JDE does not look at the correct machine.  So, although the registry is fine, ODBC is NOT and more importantly the ODBC that JDE uses is not fine.

Great article here on 32 and 64bit ODBC http://support.microsoft.com/kb/942976

Essentially;

  • The 32-bit version of the Odbcad32.exe file is located in the %systemdrive%\Windows\SysWoW64 folder.
  • The 64-bit version of the Odbcad32.exe file is located in the %systemdrive%\Windows\System32 folder.

So, we need to use the 32 bit version, best to create a shortcut to this on the desktop.

The 32 bit version

Sadly, it’s not the easiest thing to determine if a file is 64 ot 32 bit compiled / executable.  Very stupid.  As we are on the deployment server, we can use dumpbin, shipped with visual studio.  To use dumpbin from anywhere, start a cmd session and execute vcvars32 within that.

C:\Users\jde>"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"

Then goto the file that you want to test and run dumpbin /headers

c:\windows\system32 dumpbin /headers odbcad32.exe |findstr magic

You could always look at task manager too:

image

Note that entering the command with the FULL PATH to the executable will give the correct results.  You cannot rely on the current dir!

C:\Windows\System32>dumpbin /headers c:\windows\system32\odbcad32.exe |findstr machine

            8664 machine (x64)

So it is just me, or weird that the odbcad32.exe application in windows\system32 is 64bit ?

Ok, so unequivocally we’ve been able to determine the architecture of the executable for the ODBC control panel program. 

I can tell you that JDE uses the 32 bit (SYSWOW64) version to load it’s system data sources.

So how can we bulk change these ones, because if you change the ones in the registry, HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI – they are not reflected in the C:\windows\syswow64\odbcad32.exe application.  So JDE does not pick up the changes.

Easy, just don’t double click the reg file, this will call the default (higher in the path) regedit.exe – which is the 64 bit version.  You need to open the c:\windows\syswow64\regedit.exe application and then choose the reg file that you want to import.

Phew – it’s that easy!

Simply:

  • default apps are 64 bit (regedit.exe and odbcad32.exe) from the system32 dir
  • JDE uses the 32 bit apps
  • You need to manually run the 32 bit versions of these apps to see the correct data
  • use dumpbin /headers to see the machine line for architecture info

No comments:

Extending JDE to generative AI