Microsoft KB Archive/942976

= The 32-bit version of the ODBC Administrator tool and the 64-bit version of the ODBC Administrator tool display both the 32-bit user DSNs and the 64-bit user DSNs in a 64-bit version of the Windows operating system =

Article ID: 942976

Article Last Modified on 12/13/2007

-

APPLIES TO


 * Microsoft Open Database Connectivity 4.21

-



SYMPTOMS
A 64-bit version of the Microsoft Windows operating system includes the following versions of the Microsoft Open Database Connectivity (ODBC) Data Source Administrator tool (Odbcad32.exe):
 * The 32-bit version of the Odbcad32.exe file is located in the %systemdrive%\Windows\SysWoW64 folder.
 * The 64-bit version of the Odbcad32.exe file is located in the %systemdrive%\Windows\System32 folder.

The Odbcad32.exe file displays the following types of data source names (DSNs):
 * System DSNs
 * User DSNs

Symptom 1
The 32-bit version of the ODBC Administrator tool displays 32-bit system DSNs, 32-bit user DSNs, and 64-bit user DSNs. The 64-bit version of the ODBC Administrator tool displays 64-bit system DSNs, 32-bit user DSNs, and 64-bit user DSNs.

Symptom 2
The SQLDataSources function returns all versions of user DSNs, regardless of the architecture of the application. The SQLDataSources function that is called in a 32-bit application returns only system DSNs for 32-bit drivers but returns user DSNs for both 32-bit drivers and 64-bit drivers. Similarly, the SQLDataSources function that is called in a 64-bit application returns only system DSNs for 64-bit drivers but returns user DSNs for both 32-bit drivers and 64-bit drivers. Therefore, if the application makes a connection by using a user DSN that is returned from the SQLDataSources function, you may receive the following error message:

Data source name not found and no default driver specified

For example, consider the following scenario. You create a user DSN for the 32-bit driver &quot;Microsoft Access Driver (*.mdb).&quot; This driver does not have a corresponding 64-bit version. The SQLDataSources function that is called in a 64-bit application returns this 32-bit user DSN. However, if you make a connection through this 32-bit user DSN, you receive the error message that is mentioned earlier in this section.



CAUSE
The user DSNs are stored under the following registry subkey:

Registry redirection is not enabled for this registry subkey. Therefore, user DSNs are visible in both the 32-bit and 64-bit versions of the ODBC Administrator tool.



RESOLUTION
To maintain backward compatibility, no resolution for this problem is currently available.



WORKAROUND
To work around this problem, use the appropriate version of the ODBC Administrator tool. If you build and then run an application as a 32-bit application on a 64-bit operating system, you must create the ODBC data source by using the ODBC Administrator tool in %windir%\SysWOW64\odbcad32.exe. To indicate the type of DSN, you can add &quot;_32&quot; to the 32-bit user DSNs and &quot;_64&quot; to the 64-bit user DSNs.



MORE INFORMATION
The 64-bit ODBC Administrator tool can be invoked from Control Panel to manage user DSNs and system DSNs that are used by 64-bit processes. On a 64-bit operating system, the 32-bit ODBC Administrator tool is used for Windows on Windows 64 (WOW64) processes. You must directly invoke the 32-bit ODBC Administrator tool from the SysWoW64 folder. You can use the 32-bit ODBC Administrator tool to manage user DSNs and system DSNs that are used by WOW64 processes.

System DSNs are stored in the following registry subkey:

Registry redirection is enabled for this registry subkey. Therefore, system DSNs for 32-bit drivers and for 64-bit drivers are separated. The 64-bit ODBC Administrator tool does not display system DSNs that are created by the 32-bit ODBC Administrator tool. Similarly, the 32-bit ODBC Administrator tool does not display system DSNs that are created by the 64-bit ODBC Administrator tool. Also, the 64-bit ODBC Administrator tool does not display system DSNs that use 32-bit drivers. Similarly, the 32-bit ODBC Administrator tool does not display system DSNs that use 64-bit drivers.

User DSNs are stored in the following registry subkey:

Registry redirection is not enabled for this registry subkey. Therefore, both ODBC Administrator tools display all user DSNs.

For more information about registry redirection, visit the following Microsoft Developer Network (MSDN) Web site:

http://msdn2.microsoft.com/en-us/library/aa384232.aspx

Keywords: kbexpertiseadvanced kbtshoot kbprb KB942976

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.