22

how can i fix this error? ERROR [IM014] [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application.. it is occuring in a new project that i am doing... im using vb 2008 , MYSQL as my database and windows 8.1 as my OS

i read on forums that you just fix with the odbc administrator tool... i tried creating my DSN there but it still doesnt work... i tried opening an old project of mine it works fine.. but this new project keeps getting that error.. i need this to work so that i can do my crystal reports.. i've been trying to fix this error for a full day now and i cant fix it..

can someone help me? THANKS..

bolek evora
  • 231
  • 1
  • 2
  • 8

5 Answers5

22

its a 64 vs 32 bit issue. You are accessing a 32 bit odbc driver on a 64 bit system.

IF YOU OPEN c:\windows\system32\odbcad32.exe you will not see a driver there that is in c:\windows\syswow64\odbcad32.exe (or just the opposite)

Check the target platform of your application, and if that doesn't fix it, you might be able to sneak by just installing the correct driver ( 64 or 32 bit )

If you are debugging the project from Visual Studio, you will also need to run it as 32-bit. In order to do this you need to open the project properties by right clicking on the project and selecting properties. Once here you need to set Run64BitRuntime to FALSE.*

enter image description here

J.C. Gras
  • 4,934
  • 1
  • 37
  • 44
  • 1
    in vb you cannot see the target platform (to my knowledge) the only thing i see there is ANY CPU... how do i change the target platform?.. – bolek evora Jan 28 '14 at 04:56
  • see this stackoverflow thread. The first comment below the question answers your question above. http://stackoverflow.com/questions/6904529/change-target-to-x86-in-vs2010 –  Jan 28 '14 at 07:09
5

After searching on the internet I found the solution for my .vb project:

  1. Open ODBC Data Sources (32-bit) (location: C:\Windows\syswow64\odbcad32.exe)
  2. Open tab System DNS
  3. Add -> Sybase ACE ODBC Driver -> Fill in Name (example: DSN_32), net work address (address and port, example: 192.168.1.1,4100) and database name -> Test connection ->OK

enter image description here

  1. From your application, update your connection string to use DSN=DSN_32 Example:

value="PWD=123456;DSN=DSN_32;UID=123456;SRVR=123456;DB=123456"

enter image description here

Hope this helps.

anhtv13
  • 1,636
  • 4
  • 30
  • 51
5

RESOLVED !

  1. Go to IIS.
  2. Choose Your app pool.
  3. Go To Advanced Settings, and
  4. Enable enable32bitAppOnWin64
Fad Sel
  • 99
  • 2
  • 6
1

This is how I solved it to access a MS Access database via ODBC. Make sure that your bit architecture matches everywhere. For instance, in my case this is the only setup that worked on my W10 pro 64 bit PC, accessing a MS Access database hosted on a W2012 64 bit server. On my PC:

  • Install XAMPP 32bit (I tried 64 bit, but it gave me the "architecture mismatch" error)
  • Install AccessDatabaseEngine.exe 32 bit version (available from Microsoft)
  • Configure your data source using the 32 bit program: C:\Windows\SysWOW64\odbcad32.exe. There I selected the "Microsoft Access Driver (*.mdb, *.accdb)" driver.
Manny Ramirez
  • 149
  • 1
  • 6
1

For those running things in IIS Express, this can be fixed by the Bitness setting in the project properties under the Web section. As seen in the screenshot below

Visual Studio project property settings

Craig
  • 390
  • 3
  • 13