Collection Contents Index A sample program CHAPTER 5.  The Open Client Interface pdf/chap4.pdf

Programming Interfaces Guide
   CHAPTER 4. ODBC Programming     

Using ODBC without the driver manager


ODBC applications do not generally link directly to the ODBC driver. Instead, they link to the ODBC driver manager, which in turn handles the driver or drivers that may be required.

On Windows operating systems, the driver manager is supplied by Microsoft. On other operating systems, other vendors do supply ODBC driver managers; for example, Intersolv and Visigenic supply ODBC driver managers for UNIX. However, driver managers are less generally available than on Windows operating systems.

It is also possible to develop applications that link directly to the ODBC driver. This is particularly useful on operating systems such as UNIX, where your end users may not have access to an ODBC driver manager.

You develop an application that uses the ODBC driver directly by carrying out the following steps:

Top of page  Developing ODBC applications on UNIX

An ODBC driver manager is not included with Adaptive Server Anywhere, but there are third party driver managers available. An ODBC driver manager includes the following files:

Operating system

Files

Solaris/Sparc, AIX

  • libodbc.so (libodbc.so.1)

  • libodbcinst.so (libodbcinst.so.1)

HP-UX

  • libodbc.sl (libodbc.sl.1)

  • libodbcinst.sl (libodbcinst.sl.1)

The Adaptive Server Anywhere ODBC driver is the following file:

Operating system

ODBC driver

Solaris/Sparc, AIX

  • saodbc.so

  • saodbc_r.so (saodbc_r.so.1)

HP-UX

  • saodbc.sl

  • saodbc_r.sl (saodbc_r.sl.1)

The libraries with the _r are for use with multi-threaded applications. If you are developing single-threaded applications, use the library without the _r.

If you want to use the Adaptive Server Anywhere ODBC driver without an ODBC driver manager you can do so, but you can then access only Adaptive Server Anywhere data sources. The libraries are installed as symbolic links to the shared library with a version number (in parentheses).

  To use Adaptive Server Anywhere without an ODBC driver manager:
  1. If you are creating a custom ODBC application, you can link directly to the Adaptive Server Anywhere ODBC driver.

  2. If your application requires an ODBC driver manager, create symbolic links for both the libodbc and libodbcinst shared libraries to the Adaptive Server Anywhere ODBC driver.

Data source information 

If an ODBC driver manager is present, Adaptive Server Anywhere queries the driver manager for data source information. If Adaptive Server Anywhere does not detect the presence of an ODBC driver manager, it uses ~/.odbc.ini for data source information.

Top of page  

Collection Contents Index A sample program CHAPTER 5.  The Open Client Interface pdf/chap4.pdf