Page 1 of 1

wxDb for 32-bit OS vs 64-bit OS

Posted: Thu May 23, 2019 7:26 pm
by bli88
Hi there,
We have an application using wxWidgets/wxDb to access the SQL Server database through ODBC data source on a 32-bit platform. After moving to 64-bit OS, the same application is not working anymore as the call wxDbGetDataSource() and wxDbGetConnection() do not return anything. What could be the problem? Thanks for your helps in advance!

Re: wxDb for 32-bit OS vs 64-bit OS

Posted: Thu May 23, 2019 8:16 pm
by doublemax
Are you using a very old wxWidgets version by any chance? AFAIR one of the reasons the integrated ODBC support in wxWidgets was dropped, was because it was not 64bit compatible and there was nobody who could maintain the code.

You should look into wxDatabase:
https://github.com/mtangoo/wxDatabase

Re: wxDb for 32-bit OS vs 64-bit OS

Posted: Thu May 23, 2019 8:20 pm
by bli88
Yes, it's a pretty old version - 2.6.2.
So, we cannot use this method anymore on the 64-bit OS?
Thanks for you reply!

Re: wxDb for 32-bit OS vs 64-bit OS

Posted: Thu May 23, 2019 8:37 pm
by doublemax
So, we cannot use this method anymore on the 64-bit OS?
I'm not 100% sure, i just had a faint memory that 64bit compatibility was one of the problems with the old ODBC support.

But if i understand you correctly, you just changed the OS, you didn't compile the app for 64bit? Usually i would expect this to work, but i have no idea what the problem could be. Is it possible that only a 64bit ODBC driver is installed on the system?

Re: wxDb for 32-bit OS vs 64-bit OS

Posted: Thu May 23, 2019 8:45 pm
by bli88
Yes, we changed the 64-bit ODBC driver, but did not recompile the app for 64-bit. The installation of the app worked without problem and everything else worked as well. Only when trying to access the DB it's not working.

Re: wxDb for 32-bit OS vs 64-bit OS

Posted: Thu May 23, 2019 9:26 pm
by doublemax
Is there also a 32bit ODBC driver installed? You probably need that to access it from a 32bit application.

Re: wxDb for 32-bit OS vs 64-bit OS

Posted: Fri May 24, 2019 12:28 am
by bli88
Thanks again for your very good suggestion! I'll try it out tomorrow.

Re: wxDb for 32-bit OS vs 64-bit OS

Posted: Fri May 31, 2019 12:48 pm
by bli88
Thanks to @doublemax! Using the 32-bit ODBC Data Source Administrator, I was able to make it working without having to make any code changes.