Knowledgebase
[QODBC-ALL] Troubleshooting - Data source name not found and no default driver specified
Posted by Jack - QODBC Support on 17 January 2018 02:27 PM

Troubleshooting - Data source name not found, and no default driver specified

Problem Description:

 

Overview

 

This article explains how to resolve the following ODBC error when connecting to QODBC Desktop, QODBC Online, or QODBC POS:

 

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

 

This error indicates that the ODBC Driver Manager could not locate the specified Data Source Name (DSN) or the required ODBC driver.

 

Symptoms

You may encounter this error in situations such as:

  • Connecting to QODBC from a Microsoft Excel Add-in.
  • Running a .NET application that uses ODBC.
  • Connecting from third-party applications.
  • Using a Terminal Server or Remote Desktop environment.
  • Using a DSN-less ODBC connection.

 

For example:

  • QODBC works correctly when queried directly from Microsoft Excel using Data > Get Data > From ODBC.
  • A standalone .NET application successfully retrieves data.
  • The same application fails when executed as an Excel Add-in with the following error:

 

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

 

 

You are running QODBC on a terminal server and have configured a 64-bit DSN that points to a 64-bit DSN. QODBC works correctly in most scenarios:

  • A custom .NET test application connects to QODBC and successfully retrieves data.
  • 64-bit Excel can query QODBC directly through Data > Get Data > From Other Sources > From ODBC.

However, when the same file is copied to another workstation, it does not work.

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

 

Solution:

Cause 1: The data source (DSN) you are attempting to connect to does not exist on your machine.

On Windows, data sources are created by the Microsoft ODBC Administrator. The available System data sources are listed in the System DSN tab. The User data sources available for the currently logged-on user are listed in the User DSN tab.

  1. Open the appropriate ODBC Data Source Administrator.
    • 64-bit Administrator

      C:\Windows\System32\odbcad32.exe
    • 32-bit Administrator

      C:\Windows\SysWOW64\odbcad32.exe
  2. Verify that the DSN specified in your application exists.
  3. Confirm that the DSN name exactly matches the name used in your connection string.
  4. Verify whether the DSN is created as:
    • User DSN
    • System DSN
  5. If the DSN does not exist, create it using the QODBC Setup Wizard.

Note: The following steps apply to QODBC Desktop, QODBC Online, and QODBC POS. Select the appropriate DSN for the product you are using.

If you have copied your MS Excel file or MS Access file from another machine, ensure you have installed the QODBC driver and have added the DSN you are using on the source machine.

Cause 2: The Application Does Not Have Permission to Access the DSN

Windows stores ODBC Data Source Names in the registry.

If the application is running under a different Windows account or a service account, it may not have permission to access the required DSN.

Registry Locations

System DSN

HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI

User DSN

HKEY_CURRENT_USER\Software\ODBC\ODBC.INI

Resolution

  1. Determine which Windows account is running the application.
  2. Verify that the account has permission to access the appropriate registry key.
  3. If the application runs as:

    • a Windows Service
    • IIS Application Pool
    • Scheduled Task
    • Terminal Server session

    ensure that the required DSN is accessible to that account.

  4. If multiple users require access, consider creating the DSN as a System DSN instead of a User DSN.

Cause 3: 32-bit and 64-bit Architecture Mismatch

The application architecture must match the architecture of the ODBC driver and DSN.

Examples:

ApplicationRequired Driver
32-bit Excel 32-bit QODBC
64-bit Excel 64-bit QODBC
32-bit .NET Application 32-bit QODBC
64-bit .NET Application 64-bit QODBC

If the application attempts to use a driver with a different architecture, the Driver Manager may not locate the DSN and will return the IM002 error.

Resolution

  1. Determine whether your application is running as 32-bit or 64-bit.
  2. Open the matching ODBC Administrator:

    64-bit

    C:\Windows\System32\odbcad32.exe

    32-bit

    C:\Windows\SysWOW64\odbcad32.exe
  3. Verify that the QODBC driver appears in the Drivers tab.
  4. Verify that the required DSN exists in the corresponding ODBC Administrator.
  5. If necessary, recreate the DSN using the correct version of the ODBC Administrator.

Cause 4: Incorrect DSN in the Connection String

The connection string references a DSN that does not exist.

Example:

DSN=QODBC_Test;

If the actual DSN is named:

QODBC Desktop

the connection will fail.

Resolution

Verify that the DSN name in the connection string exactly matches the configured DSN.


Cause 5: Excel Add-in Running Under a Different Context

In some environments, particularly on Terminal Servers or Remote Desktop Services, an Excel Add-in may execute under a different user context than a standalone application.

As a result, it may not have access to a User DSN that is available only to your Windows profile.

Resolution

  • Create the DSN as a System DSN if appropriate.
  • Verify that the Add-in is running under the expected Windows user account.
  • Confirm that the correct version (32-bit or 64-bit) of Excel is installed.
  • Verify that the corresponding QODBC driver is installed.

Additional Troubleshooting Checklist

Before contacting support, verify the following:

✔ The DSN exists.

✔ The DSN name is spelled correctly.

✔ The application and QODBC have the same architecture (32-bit or 64-bit).

✔ The correct ODBC Administrator was used to create the DSN.

✔ The QODBC driver is installed.

✔ The Windows account has permission to access the DSN.

✔ The application is using the expected Windows user account.

✔ The connection string references the correct DSN.


Additional Information

For more information about this ODBC Driver Manager error, refer to Microsoft's documentation:

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

If the issue persists after following the steps in this article, please contact Flexquarters Technical Support and include the following information:

  • QODBC product and version
  • Windows version
  • Whether the application is 32-bit or 64-bit
  • Whether the DSN is a User DSN or System DSN
  • The complete error message
  • A copy of the connection string (remove any sensitive information before sharing)

Please refer to the link below for more details:

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

 

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please complete the captcha below (we use this to prevent automated submissions).