In Part 1 we looked at what ODBC does and how it works. We said that ODBC is divided logically into three parts: database drivers which are required for each database that is accessed, the Driver Manager which dynamically loads and unloads database drivers when connecting to a data source, and the Administrator which provides a user interface and routines for defining data sources from/for the database drivers. This month's article discusses where to get the Driver Manager and Administrator and how to install them. Installing each of the database drivers is held off until next month in Part 3 because the installation of each database driver is so different and specific to the database. We will also quickly cover installing the ODBC components on WinOS2.
Before we talk about installing ODBC we must talk about versions of ODBC. ODBC has evolved from the original version 1 to the latest version 3 for OS/2 (there is a version 3.5 available for Windows but it has never been implemented in OS/2.) Each later version added more features and functions to the ODBC specification. As a user accessing data in an application via ODBC you won't notice the difference between the versions because the application will mask the differences. However you must be aware of the versions in order to insure that the ODBC pieces work together. The versions affect the database drivers, the Driver Manager and the Administrator; the Administrator of any version will work with ODBC components of any other version, but the Driver Manager must be the same or a higher version than the highest version of any database driver you have. In other words, if you have an ODBC database driver that is version 2.5 and another database driver that is version 3 then you must have a Driver Manager that is at version 3 - but you can use any version Administrator you want. If all the database drivers you have are at version 2.5 then you only need a version 2.5 Driver Manager. The vast majority of ODBC database drivers are version 2.5; in fact the only database drivers that are at version 3 that I know of are bundled with Lotus SmartSuite.
In an ideal world the ODBC files - the Driver Manager and Administrator - would be included as part of OS/2. But since they aren't, you are going to have to go and get them. And since the companies that made the ODBC components for OS/2 don't want to sell them anymore, we have to be creative about where we get them.
The Driver Manager and Administrator are not available by themselves, but they are available bundled in various ways:
ODBC components, both drivers and the Driver Manager and Administrator, were also available in other bundles such as the short-lived IBM Visual Basic package and the Visual Query product, neither of which is readily available today.
The Driver Manager and Administrator were made and distributed by two different vendors: Intersolv (now Merant) and Visigenic (now Borland.) Components from those two vendors are interchangeable and interoperable. There is also a Driver Manager from the Unix iODBC project available for OS/2 which is not interoperable with the Visigenic/Intersolv components and doesn't work with most of the available ODBC applications for OS/2 - at least I have not been able to get them to work together.
Installing ODBC involves:
(Installing ODBC database drivers involves copying the driver file or files to your hard drive and adding statements to the ODBCINST.INI file for that driver, which is covered in next month's article: Part 3.)
I offer the following suggestions on the installation:
All three bundles in the list above have problems either with their installation routines or with bugs in the installed files, therefore each of the packages has its own section below.
SPECIAL NOTE: If you have ODIN installed on your system you MUST rename the ODBC*.* files in the ODIN\SYSTEM32 directory to some other names. Otherwise they will conflict with the OS/2 ODBC files. Currently I do not know of any way for ODIN ODBC to co-exist with OS/2 ODBC.
The ODBC stuff is not installed by default. You have to use a "custom" install and select the ODBC items in order to get them to install. Lotus SmartSuite is located on the second CD of eCommStation in the SS directory. The install program is Install.Cmd.
Select CUSTOM install.
Each of the SmartSuite applications has a customize option that you use to specify what components you want to install.
In the application specific screen, the tabs at the top will get you to the ODBC parts. Be sure to select all the ODBC options. Do this for each of the applications - although not all the applications have ODBC parts available in the customize settings. The screen shot below show the customize install screen for WordPro. The screens for the other applications are similar. You may have to scroll the tabs at the top to get to the ones with ODBC.
Once you have completed the Lotus install, the ODBC stuff, and the various database driver files and the Driver Manager/Administrator files are located in x:\LOTUSW4\COMPNENT directory and the ODBC Administrator icon is located in the Lotus Accessories folder. There are three potential problems with this install:
The version 2.5 Administrator is shown below - it has buttons down the right side.
The solutions for each of these potential problems are:
To move the ODBC files from the lotusw4\compnents directory you should:
You can solve the ODBC Administrator bug by installing the v 2.5 Administrator and then use the v 2.5 administrator by itself, or use both.
Since the file ODBCCP.DLL is common to the administrator and the driver manager, if you are running the v 3 driver manager and the v 2.5 administrator you should not open the administrator when any ODBC applications are running.
While the ODBC version 3 Driver Manager will run v 2.5 and lower drivers, Intersolv database drivers use some additional files for license control and other stuff. Driver Manager will not run earlier version Intersolv database drivers without some massaging. To run Intersolv v 2.11 and v 3.01 use the following steps:.
Some final advice: If you also have DB2 installed, move the SQLLIB path statements in the LIBPATH part of your config.sys after the LOTUSW4/COMPNENT statement (or the directory where you move the ODBC files.) To avoid conflict with PMVIEW when running Matrox 2.23 drivers move the LOTUSW4/COMPNENT statement after the OS2 and OS2/DLL statements in the LIBPATH statement in CONFIG.SYS. Otherwise PMVIEW will freeze up.
The PostgreSql ODBC driver includes the ODBC v 2.5 Driver Manager and Administrator. Unfortunately, the installation program included with that driver incorrectly installs the ODBC components. When the program is finished you cannot add PostgreSql as an ODBC Data Source using the Administrator. The easiest way to fix this problem is to use the ODBC installer program. ODBCINST (http://hobbes.nmsu.edu/cgi-bin/h-search?key=ODBCINST.zip) (You could also copy the files manually and manually create the ODBCINST.INI file if you prefer.)
To use ODBCINST, start the program ODBCINST.EXE. Enter either the file psqlodbcos2.zip as the source file, or unzip psqlodbcos2.zip to a temporary directory and enter that directory as the source.
Enter the destination for the ODBC INI files. The default should not be changed unless you have a very good reason to do so.
If you want to install the PostgreSql ODBC driver, select it from the list. In the figure below, two drivers, Watcom SQL and SQL Anywhere, are in the driver list. The drivers that appear in the list will depend on what drivers are the source directory/file and what databases you have installed on your machine.
DB2/2 comes with ODBC v 2.5, and a nice, working, ODBC installer. To install the ODBC Driver Manager and Administrator click on the ODBC Installer icon.
This brings up the following dialog box. The Install Directory is where Driver Manager and Administrator files are located (actually they are located in BIN and DLL subdirectories.) The Driver Directory is where the DB2 ODBC database driver files are placed. The ODBC INI files are always put (or modified) in the directory pointed to by the ODBC_PATH environment variable, or if that doesn't exist, in the C:\OS2 directory. If the ODBC_PATH variable points to a non-existent directory then the ODBC INI files are not created and no error message is given.
The best way to install the ODBC components is to use the ODBC Installer application ODBCINST. The steps are similar to installing from the PostgreSql bundle.
WinOS2 applications, since they are Windows 3.1 applications, use their own Windows 3.1 specific ODBC. You have to install the Windows ODBC files and any Windows ODBC database drivers you need in order to use ODBC from WinOS2. There is no "bridge" between WinOS2 ODBC and OS/2 ODBC that I am aware of. The company OpenLink makes a bridge that allows ODBC applications in one operating system to use ODBC drivers in another operating system - which would work perfect for WinOS2 to use OS/2 ODBC drivers, but they have not released that bridge for OS/2.
Windows ODBC is easy to come by. Almost all Windows applications that access data include the ODBC setup and some drivers. This include MS Access, Excel, Delphi, ReportSmith, etc.
ODBC is not integrated into OS/2 as it is in Windows, which means we must work harder to install it. However the install is not that painful and the rewards are great. Once installed it works well and provides all the same benefits to us on OS/2 as it does on Windows. Next month in Part 3 we discuss the ODBC drivers and ODBC enabled databases that exist for OS/2. While I could not get my hands on all the drivers and/or databases that existed for OS/2, I did get ahold of a lot of them. We discuss where to get them and how to install them. And we do a mini-comparison of OS/2 hosted databases that are ODBC enabled.
This article is courtesy of www.os2ezine.com. You can view it online at http://www.os2ezine.com/20010616/page_9.html.