Windows – System DSN vs user DSN

32-bit64-bitdsnodbcwindows 7

Every new computer in my company undergoes the same software installation process; one program in particular needs to access a MS SQL Server database via ODBC. The program is then used by multiple domain users on the same computer at different times.

On Windows XP machines, I simply set up the ODBC connection as a System DSN. No matter what user logged in, the connection would work for him, and my job was done.

Recently, we get more and more Windows 7 machines, and this method doesn't seem to work anymore. The program doesn't recognize the connections I set up in System DSN, but it does recognize those in User DSN. The problem I have with this is that every time a user logs in on a computer for the first time, I get a call and need to install his or her own DSN.

What's the reason this works on XP, but not on 7? Have I been doing it wrong from the start?

Update: Maybe the reason isn't Windows 7, but the fact that the new computers run a 64-bit OS. I say this because when I ran a test application (source code here) on 64-bit Windows 7, accessing the User DSN worked fine, but accessing the System DSN gave the following error message:

IM014: The specified DSN contains an architecture mismatch between the Driver and Application

The Microsoft documentation indicates that this happens when a 32-bit driver is accessed on a 64-bit computer, or vice versa. This could very well be the problem, because when I switched the test application to 64-bit, the System DSN could be accessed.

The question now is: Why does this happen for System DSN, but not for User DSN – are there different drivers installed for the two? That would mean that I won't be able to use the System DSN any longer, because I have no influence on the software we need to use.

Best Answer

  • The Microsoft article of Managing Data Sources says the following :

    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. In Administrative Tools on a 64-bit Windows 8 operating system, there are icons for both the 32-bit and 64-bit ODBC Data Source Administrator dialog box.

    If you use the 64-bit odbcad32.exe to configure or remove a DSN that connects to a 32-bit driver, for example, Driver to Microsoft Access (*.mdb), you will receive the following error message:

    The specified DSN contains an architecture mismatch between the Driver and Application

    To resolve this error, use the 32-bit odbcad32.exe to configure or remove the DSN.

    Your application is evidently 32-bit. Have you used the right odbcad32.exe to define the DSN ?

  • Related Question