0

I have a desktop application in vb.net which runs fine in Windows XP but after installing the application on Windows 7 64 bit its not able to run. The 32 bit ODBC does show the driver for DB2 connection(Version 9.7) but the version 64 bit of ODBC does not show it.I connect to DB2 using System DSN in Windows XP and tried the same in Windows 7 as well.

Thus i have to explicitly provide the information in the code itself to call the 32 buit version of it. Need help. Do let me know if there are some changes to be done in application just than calling.

Ashu!

Ashu
  • 31
  • 1
  • 3
  • 10
  • Does it mean I should change the platform on the application to be of type x86 and then try running it. Would it by default point to the 32 bit ODBC version. Because the driver for 64 bit version does not seem to be available. I also read somewhere that in order to call 32 bit ODBC it should be like as below... Dim sConStr as String sConStr = "DSN=MY400;UID=HARNER;PWD=SECRET;" Dim sConStr as String sConStr = "Driver=Client Access ODBC Driver (32-bit);" sConStr = sConStr & "System=192.168.1.25;UID=HARNER;PWD=SECRET;" – Ashu Apr 12 '13 at 14:37

1 Answers1

2

You cannot mix 32-bit code and 64-bit code in the same process.

If you want to use 32-bit ODBC, you must mark your process as x86-only.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
  • that's correct. I might add that it's possible to run both 32-bit and 64-bit driver towards the same target, but you have to add them twice; one in the 32-bit driver and one in the 64-bit. This can be useful if you run some applications in 32-bit mode and some in 64. – Allman Apr 12 '13 at 14:18
  • Does it mean I should change the platform on the application to be of type x86 and then try running it. Would it by default point to the 32 bit ODBC version. Because the driver for 64 bit version does not seem to be available. – Ashu Apr 12 '13 at 14:28
  • @Ashu: Your program will always use the same bitness of ODBC that it's running as – SLaks Apr 12 '13 at 19:40
  • yes @Ashu, if you compile towards x86, the application should try to use the 32-bit driver. – Allman Apr 15 '13 at 05:37
  • I changed the connection to use OLEDB connection and organised the connection string fine. But for some reason even on x86 compilation did not make my code work for connecting with 32 bit ODBC – Ashu Apr 15 '13 at 13:46
  • There was a typo in my code. problem fixed by correcting the DSN and compiling it as x86 ..Thanks – Ashu Apr 15 '13 at 18:29