Feedback
 
Did this article resolve your question/issue?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025

 


Article

DataDirect "Data source name not found and no default driver specified" error

« Go Back

Information

 
Article Number000002747
EnvironmentProduct: Connect/Connect64 XE for ODBC, SequeLink ODBC Client, OpenAccess ODBC Client
Version: All supported versions
OS: All supported platforms
Database: All supported databases
Application: All ODBC applications
Question/Problem Description
When trying to connect to a database, an error is returned indicating that the ODBC data source name could not be found and there is no default driver specified.
Steps to Reproduce
Clarifying Information
Error Message[DataDirect][ODBC lib] Data source name not found and no default driver specified
[INTERSOLV][ODBC lib] Data source name not found and no default driver specified
[MERANT][ODBC lib] Data source name not found and no default driver specified
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
[DataDirect][ODBC Informix Wire Protocol driver]Connection refused. Verify Host Name and Port Number
Defect/Enhancement Number
Cause
The application is not able to locate the ODBC data source specified in the connection string. There are a few common causes:
  • Wrong Application Executable and Linking Format (ELF).
  • Misspelling of DSN or Driver
  • Invalid or missing environment configuration
Resolution

Wrong Application Executable and Linking Format (ELF)

It is important that the ODBC driver's executable and linking format (ELF) is the same as the application. In other words, a 32-bit driver is needed for use with  a 32-bit application or a 64-bit driver for a 64-bit application.

If these do not match, it is possible to configure a DSN for a 32-bit driver and when an attempt is made to use that DSN in a 64-bit application, the DSN won't be found because the registry holds DSN information in different places depending on ELF (32-bit versus 64-bit).
 
Be sure to use the correct ODBC Administrator tool. On 32-bit and 64-bit Windows, the default ODBC Administrator tool is in c:\Windows\System32\odbcad32.exe. However, on a 64-bit Windows machine, the default is the 64-bit version. If the 32-bit ODBC Administrator tool is needed on a 64-bit Windows system, run the one found here: C:\Windows\SysWOW64\odbcad32.exe
 

Misspelling of DSN or Driver

This can happen because the data source name or driver name is invalid (such as with a typo in the data source name, in the odbc.ini or the connection string in the application) 

Verify that the name of the ODBC data source in the connection string is identical to an existing ODBC data source.
 

DSN contains special character(s).​

As per the ODBC Specification, a DSN should not contain the []{}(),;?*=!@ characters, and the value of the DSN keyword cannot consist only of blanks. Because of the registry grammar, keywords and data source names cannot contain the backslash (\) character.
 

Invalid or missing environment configuration

The environment may not be configured correctly (such as when the wrong odbc.ini file is being located or there is an error in the structure of the odbc.ini).

Follow the steps below to check the configuration.


1. For applications running on Windows

  • If application is running as a service on Windows ( eg: Microsoft Internet Information Server IIS ), create a SYSTEM (instead of a USER) ODBC data source name so that the data source is available for all users on the system.
  • When running on x64 windows machines, make sure to install and configure a 32-bit driver when using 32-bit applications, and a a 64-bit driver when using 64-bit applications.
    The 32-bit version of the ODBC administrator tool (odbcad32.exe) file is located in the %systemdrive%\Windows\SysWoW64 folder.
    The 64-bit version of the ODBC administrator tool (also named odbcad32.exe) file is located in the %systemdrive%\Windows\System32 folder.

2. For applications running on Unix/Linux:

  • Verify that the ODBCINI (or ODBC_INI or SHADOW_INI) environment variable points to the correct odbc.ini (or shadow.ini) file in which the ODBC data source is defined. For example:
    export ODBCINI=/opt/odbc32v53/odbc.ini
    • Specify the fully qualified name inside odbc.ini file (path + filename)
    • Environment variable name (such as ODBCINI) must be in uppercase
    • Ensure that the file has read permissions for everyone
    • When launching an application through a batch file or shell script, ensure that the batch file/shell script does not reset the ODBCINI environment variable.
  • Verify that the odbc.ini file is valid.
    • Add a section called [ODBC Data Sources] in odbc.ini file where the data source names are listed and the corresponding driver description. For example:

      [ODBC Data Sources]
      DB2 Wire Protocol=DataDirect 5.3 DB2 Wire Protocol
      datasourcename=driver description
  • Add the ODBC data source name between square brackets in odbc.ini file and make sure there is a line for the driver. Each option must be specified on its own line. For example:

    [MYDATASOURCENAME]
    Driver=/home/support/soft/odbc32v53/lib/ivdb223.so
    otheroption=optionvalue
 
  • Verify that there are no erroneous extra brackets '[' / ']' or extra spaces in the odbc.ini file.

Ensure no extra spaces are present after the HostName, PortNumber or Password parameters in the ODBC data source.
Execute the following UNIX / Linux command to ensure that the line formatting in the odbc.ini is in UNIX style, not in Windows/DOS style.

dos2unix odbc.ini

 

NOTE: Use the tools example and demoodbc which ship with Connect and SequeLink software to test the ODBC connectivity outside of application.
 

3. For SequeLink users:

The source of the error may be the SequeLink ODBC client or the SequeLink Server.

  • When the error reads "[DataDirect][ODBC lib] Data source name not found and no default driver specified." the problem is with the SequLink ODBC Client. Follow the steps in 1 and 2 above.
 
  • When the error reads "[DataDirect][ODBC SequeLink driver][ODBC Socket][DataDirect][ODBC lib] Data source name not found and no default driver specified" the problem is with the SequeLink Server for ODBC Socket and/or ODBC driver configuration on the SequeLink Server
    • Verify that the ODBC connection used by the SequeLink Server for ODBC Socket is working fine. For example, use the tool 'example' which ships with the DataDirect Connect for ODBC drivers to ensure that no errors occur upon connection to ODBC data source.
    • When the ODBC connection used by the SequeLink Server for ODBC socket is successful using a test tool, verify that the SequeLink ODBC Socket Server service advanced data source variable DataSourceSOCODBCConnStr is pointing to the correct SYSTEM (not USER) ODBC data source name. For example:

      DataSourceMSSODBCConnStr=DSN=datasource_name;
      UID=user_name;
      PWD=password
  • To use a DSN-less connection, ensure the case-sensitive value specified in the Driver= portion does not contain any spaces. For example:
    DataSourceMSSODBCConnStr=Driver={DataDirect 5.3 dBASEFile (*.dbf)};Database=C:\mydata
  • On UNIX/Linux, verify that the following SequeLink ODBC Socket Server service variables have been properly set:

    ServiceEnvironmentVariable ISLVINI=/opt/slserverxx/ipe
    ServiceEnvironmentVariable ODBCINI=/opt/odbcxx/odbc.ini
    ServiceEnvironmentVariable SHLIB_PATH=/opt/odbcxx/lib:/opt/slserverxx/bin

4. If using third party ODBC drivers

  • On Windows: Refer to the third party ODBC driver documentation and contact the third party ODBC driver vendor for support.
    If it is a Microsoft ODBC driver manager issue, contact Microsoft (https://support.microsoft.com/en-us) for support.
     
  • On UNIX/Linux: Refer to the third party driver ODBC documentation and contact the third party ODBC driver vendor for support.
    If it is a DataDirect driver manager issue, contact Progress Software for support as per 000005087, How to contact Progress DataDirect Technical support.
Workaround
Notes
References to other documentation: 
ODBC Programmer's Reference > ODBC Reference > Setup DLL API Reference
https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/setup-dll-api-reference
Attachment 
Last Modified Date6/6/2019 10:01 PM