Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends,

I have got the error message


ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified


I am using VS 2005 and ADO.net programming.


I am running windows 8 64 bit.

I have installed 64 bit dotnet framework, Crystal reports setup for V2.0, Postgres 8.2, postgres odbc connector setup (Downloaded from postgres website), Created a DSN in Control panel -> Administrative tools -> ODBC 32 bit -> System DSN -> Postgres ANSI.

But still my APP is not working


Please help me out.

This app works fine in Windows xp, Vista, 7. But not working in windows 8.
Posted

1 solution

Probably because your app is compiled to target "Any CPU". So, on a 64-bit machine, your code runs as 64-bit and on a 32-bit machine, your code runs as 32-bit.

The problem is that you cannot combine 32- and 64-bit code in the same process. Your 64-bit app cannot use a 32-bit Postgres driver. So, you have two choices.

1) Find a 64-bit Postgres driver and install it.

2) Go into your project Properties, Build tab, and change the target from Any CPU to x86. That'll force your code to run as 32-bit only on 64-bit machines.
 
Share this answer
 
Comments
Member 11376476 17-Jan-15 23:33pm    
Hi Dave Thank you very much. I used your second choice it worked for me.

Thank you once again.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900