How do I connect to my 64-bit SQL Server with ODBC?

70,245

Solution 1

You're right in that it has to do with the bits.

Hope this helps:

--From MSDN --

To manage a data source that connects to a 32-bit driver under 64-bit platform, use c:\windows\sysWOW64\odbcad32.exe. To manage a data source that connects to a 64-bit driver, use c:\windows\system32\odbcad32.exe. If you use the 64-bit odbcad32.exe to configure or remove a DSN that connects to a 32-bit driver you will receive this message.

Solution 2

I've been having the same problem trying to link a 64 bit SQL 2012 server to 'Sage Timberline' using Pervasive ODBC Client Interface.

I can set up the 32 bit DSN, but SQL Server keeps giving me the "architecture mismatch" error when trying to create a linked server using the 32 bit DSN.

Solution 3

I tried the C:\Windows\SysWOW64\odbcad32.exe to add the driver. But when I set up a linked server between MAS90 and SQL Server 2008 R2 I still get the architecture mismatch error. Just spoke to a guy from Sage and he says it won't work with 64-bit edition of Sql Server. The linked server works with MAS90 only if the edition of Sql Server is 32-bit.

Solution 4

if 32 bit application on 64 bit operating system (the application you are installed under [program files (X86)] use the following C:\Windows\SysWOW64\odbcad32.exe

otherwise 64 bit application and 64 bit operating system use the following C:\Windows\System32\odbcad32.exe

otherwise you will get a error like "Architectural mismatch"

Hope this will save someone's day :)

Solution 5

I'm betting you are working with User DSNs.

Depending on your perspective, there's a "feature" or "bug" in the 64-bit Windows environment --

  1. 32-bit User DSNs show up in the 64-bit Administrator and when 64-bit client applications ask for all available DSNs -- even though the 32-bit DSNs cannot be used by the 64-bit client app and Adminstrator.

  2. 64-bit User DSNs show up in the 32-bit Administrator and when 32-bit client applications ask for all available DSNs -- even though the 64-bit DSNs cannot be used by the 32-bit client app and Adminstrator.

The error message you describe comes up anytime there's such a bitness mismatch between the DSN and the client trying to work with it.

Microsoft's recommendation is to name your User DSNs with _32 or _64, depending on the bitness of the driver on which they're based ... or stick with System DSNs.

There are 32-bit and 64-bit solutions for the connection you want. The bitness of your client application(s) -- IIS & PHP, in this case -- dictate the bitness of the solution you require.

Share:
70,245
donok
Author by

donok

I program things in Python. I'm AWS certified. I love Terraform. In the past I've programmed things in C#, Java, PHP, and more.

Updated on May 12, 2020

Comments

  • donok
    donok almost 4 years

    I recently installed SQL Server 2008 Express on my Windows 7 Ultimate x64 home machine. I also have IIS 7.5 with PHP 5.3, and I was trying to connect to SQL via ADODB, but kept getting this error:

    [Microsoft][ODBC Driver Manager] The specified DSN contains an
    architecture mismatch between the Driver and Application
    

    After doing a small amount of digging on the internet, I think this is because the SQL Server ODBC driver is meant for 32-bit operating systems, and mine's 64. First of all, am I correct? Is this the reason I'm running into trouble? Secondly, if so, how do I fix this? Are there any updated ODBC drivers that work with 64-bit operating systems? I looked but was unable to find any...

  • donok
    donok over 14 years
    I've actually tried setting things up as System DSNs. If you want, I've essentially re-asked this question over at Server Fault because it is more about server management than programming. It's still unresolved, so if you think you can solve it, by all means do! serverfault.com/questions/97074
  • Rob
    Rob about 13 years
    That worked for me too... after 30+ minutes of messing around because I had copied the wrong path. If you are reading this article, C:\Windows\SysWOW64\odbcad32.exe is the one you want.
  • Dhara
    Dhara almost 12 years
    "Just spoke to a guy" is not really a reference
  • Alex Gordon
    Alex Gordon about 11 years
    scott im having this issue, were you able to do anything aout it?