From the first glance it seems that the problem can be one of the following :
1.
Wrong connection string
Make sure that your connection string is correct in all aspects. User name,
Password, ODBC Name. If it is correct. Go to next step.
2.
Correct Target CPU
There are two different ODBC drivers for both 32-bit and 64-bit versions of
OS. So make sure you are compiling you application to correct version. I
would suggest you to change the target CPU in compile options to x86 32 bit.
3.
Correct ODBC set up
As I said there are two different ODBC drivers for 32 - bit and 64 - bit.
You can find the 32 - bit ODBC manager at C:\Windows\SysWOW64\odbcad32.exe
and 64 - bit ODBC manager at Start - Admin Tools - Data Sources. So when
you are setting the ODBC, do so at using appropriate manager.
If you are not sure which manager to use. Whatever changes you want to do,
do them using both these ODBC managers.
For further information check out :
1.
http://support.microsoft.com/kb/306345[
^]
Hope this helps.
All the best.