On Windows platforms, CLI driver
must be registered with the Windows ODBC
Data Source Administrator (odbcad32.exe), before
it can be used by an ODBC application.
Before you begin
Before
setting up the Windows
CLI environment,
ensure that the
CLI environment
is set up.
About this task
The
CLI driver
implements both
CLI application
programming interface (API) and the ODBC API. In Windows environment,
CLI driver
must be registered with the Windows ODBC
Data Source Administrator (
odbcad32.exe) before it
can be used by an ODBC application. When using the ODBC Data Source
Administrator on Windows 64-bit
platforms, by default ODBC data sources can be configured only for
64-bit applications. ODBC data sources for 32-bit applications should
be configured by using the Microsoft 32-bit
ODBC Data Source Administrator (32-bit
odbcad32.exe)
that is included with the Windows 64-bit
operating system.
- To set up Data Sources for 32-bit applications, you must use %WINDIR%\SysWOW64\odbcad32.exe.
- To set up Data Sources for 64-bit applications, you must use %WINDIR%\System32\odbcad32.exe.
Procedure
Before CLI and
ODBC applications can successfully access a DB2® database from a Windows client, perform the listed steps
on the client system:
- Verify that the Microsoft ODBC
Driver Manager and the CLI/ODBC
driver are installed. On Windows operating
systems, both drivers are installed with the DB2 database products. If a newer version of
the Microsoft ODBC Driver
Manager is already installed or you manually cleared the option to
install it, the Microsoft ODBC
Driver Manager is not installed. To verify that both drivers are installed
perform the listed actions:
- Double-click the Microsoft ODBC
data sources icon in the Control Panel, or run the odbcad32.exe command
from the command line.
- Click the Drivers tab.
- Verify that the IBM DB2 ODBC DRIVER - DB2_Copy_Name is
shown in the list. DB2_Copy_Name is
the DB2 copy name that you want
to use. See Multiple DB2 copies on the same computer
(Windows) for more
information.
If either the Microsoft ODBC
Driver Manager or the IBM® Data
Server Driver for ODBC and CLI is not installed, then rerun the DB2 installation and select the
ODBC component on Windows operating
systems. Note: The latest version of the Microsoft ODBC Driver Manager is included
as part of the Microsoft Data
Access Components (MDAC) and can be downloaded from
www.microsoft.com.
- Register the DB2 database
with the ODBC driver manager as a data source. On Windows operating systems, you
can make the data source available to all users of the system (a system
data source), or only the current user (a user data source). Use any
of these methods to add the data source:
Results
After
configuring the Windows
CLI environment,
you can now access DB2 data
source from Windows ODBC
applications.