Did this article resolve your question/issue?



How to set up and test the ODBC driver on Unix?

« Go Back


TitleHow to set up and test the ODBC driver on Unix?
URL NameP21252
Article Number000136625
EnvironmentProduct: Progress
Version: 9.X
Product: OpenEdge
Version: 10.x, 11.x
Question/Problem Description
How to set up and test the ODBC driver on UNIX?
How to install and configure the ODBC driver on UNIX?
How do I set up ODBC on UNIX?
How do I setup ODBC DSN on UNIX?
How to prepare for a UNIX to UNIX ODBC connection?
How do I configure ODBC on UNIX?
How to use ODBC on UNIX?
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
General steps needed to use the ODBC driver on UNIX:
1. Ensure that the database is started with Networking enabled (-S portnumber, no -H is needed since OpenEdge 10.1x)
2. Ensure the Progress/OpenEdge ODBC driver is installed
3. Configure and Test a Data Source
4. Compile / run the program

For the purposes of this demonstration:
  • The ODBC driver connects to the bundled sports2000 test database.  
  • It is assumed that this database is already available in the WORK directory for use. (prodb test sports2000) 
  • Create an empty $DLC/odbc/demo directory.
  • The file attached to this Article contains:
  • An odbc.ini file (tested against OpenEdge 10.2B07), 
  • An older odbc.ini file that worked with earlier releases that had the older driver, 
  • A sample odbcinst.ini 
  • Code that can be used to test the ODBC driver, demoodbc.c
To setup and test the ODBC driver:

1. A test database needs to be started with available Network Ports
proserve sports2000 -S <port> -n 10 -Mn 4 -Mi 1 -Ma 2 -minport 5000 -maxport 5005
2. The ODBC driver to use for the Data Source

The ODBC driver is in the $DLC/odbc/lib Progress Installation directory and is named as follows:
  • - Progress 9 driver
  • - OpenEdge 10 driver
  • - OpenEdge 11 driver 
The ODBC driver version can change with a new Service Pack.  Look in the current $DLC/odbc/lib directory or Refer to Article 
ODBC driver versions shipped with various OpenEdge versions    

For OpenEdge 10.2B07 or 32-bit OpenEdge running under 64-bit Linux, refer the Notes Section below for additional information.
The ODBC Drivers depend on other libraries in $DLC/odbc/lib and $DLC/lib; programs using this driver need to be able to find shared libraries in these locations.

3. In the UNIX environment, there is no standard ODBC Administration utility. To configure a Data Source, the System Information file needs to be created using any text editor to define Data Source entries. This is a plain text file that is usually called odbc.ini.

3.1. Create an odbc.ini file in the $DLC/odbc directory. 
  • A several sample odbc.ini files are included in the file attached to the Article.
  • These sample odbc.ini files relate to versions of Progress OpenEdge.  The newer the version of Progress OpenEdge the greater the number of configurable parameters.
  • Replace the settings as needed for the environment. Use the help comments inside the sample odbc.ini file for further information on the parameters and their values.
  • In this test file, the "sysprogress" account is used with password "sysprogress". It is a special account with DBA privileges, which must first be activated:
Access the Data Administration utility:
mpro <db> -p _admin.p

Through the Data Administration Security Menu add a user:
name: sysprogress 
password: sysprogress. 

3.2. Create a odbcinst.ini file in the $DLC/odbc directory. 
  • A sample odbcinst.ini file is included the file attached to the Article.
  • Example: odbcinst.ini using the OpenEdge version 10.1C03 ODBC driver 
[ODBC Drivers]


3.3. Create Environment Variables
  • ODBCINI that points to the odbc.ini file
  • ODBCINST that points to the odbcinst.ini file
  • Example: 
ODBCINI=$DLC/odbc/odbc.ini; export ODBCINI

ODBCINST=$DLC/odbc/odbcinst.ini; export ODBCINST

3.4. Set the Shared Library Path
  • The Shared Library Path enables the ODBC application to locate the ODBC core components and drivers at runtime.
  • Environment Variables: 
LD_LIBRARY_PATH on Solaris and Linux, 
  • Add the directories $DLC/odbc/lib and $DLC/lib directory to the shared library search path.
  • Example: 
4. Compile and Run the Code.

4.1. Ensure the directory $DLC/odbc/demo is empty and accessible.

4.2. Copy the demoodbc.c file (included the file attached to the Article) into the $DLC/odbc/demo directory.

4.3. Compile the Code
  • Execute the following command from within the demo directory: 
cd $DLC/odbc/demo
gcc -o demoodbc -I../include demoodbc.c -L../lib -lodbc -lodbcinst <-lpgicuXX>

The <-lpgicuXX> should be replaced with the name of the appropriate library.  
  • Example:  
libpgicu23 located in $DLC/odbc/lib would be -lpgicu23.
  • If there were no errors, a demoodbc executable will be created in the same directory. 
In AIX use the following example command to compile: 
gcc -maix64 -o demoodbc -I$DLC/odbc/include demoodbc.c -L$DLC/odbc/lib -lodbc -lodbcinst -lpgicu27 -Xlinker -bnoquiet

4.4. Run the demoodbc code
  • The demoodbc program was written for Progress sports or sports2000 database, sysprogress must be a valid user in the database.
./demoodbc -uid sysprogress -pwd sysprogress mytest 
  • The program should run without errors and demonstrates that the ODBC driver is in use and accessing the database.  A result set will be displayed, unless there was an error.

Note: There is a secondary sample C program in the doc as well

In addition some OE versions ship with sample C programs under $DLC/odbc/samples/

4.5. Errors and their resolution:

A Segmentation Fault message
This is usually indicative of an invalid odbc.ini or odbcinst.ini files.
Review the files for correct locations of driver files and the drivers used.

Contact Progress Technical Support with supporting evidence.
For older OpenEdge 10.x, use and for the gcc compiler execution, make use of -lpgicu23.
For OpenEdge 10.2B07, the driver is, and the gcc compiler execution should make use of -lpgicu25.
The ODBC API is standardized and there are a number of ODBC frameworks available on UNIX which allow to mix ODBC drivers from different vendors. Progress provides both a specific ODBC driver for the Progress and OpenEdge databases, and an ODBC framework to use this driver. It may be possible to use the ODBC driver within a third-party framework - although this has not been specifically tested by Progress.
Path names should be written in full. Environment variables cannot be used in the odbc.ini!
OS-Specific steps for compilation:
32-bit: syntax:
xlC_r -o demoodbc -I../include demoodbc.c -L../lib -lc_r -lC_r -lodbc
64-bit: syntax:
xlC_r -DODBC64 -q64 -qlonglong -qlongdouble -qvftable -o demoodbc -I../include demoodbc.c -L../lib -lc_r -lC_r -lodbc
HP-UX: syntax when linking library files:
aCC -o demoodbc -I../include demoodbc.c -L../lib -lodbc -lodbcinst -lpgicuXX

Please refer to HP documentation for a complete explanation:

Compiling 32-bit OpenEdge files under 64-bit Linux
The following packages may be needed:  glibc-devel.i686 libgcc.i686 libstdc++-devel.i686 ncurses-devel.i686

To install these (the following option will likely be needed to override yum install because the current environment is 64-bit.


Example of the yum command to install the above files:

sudo yum install glibc-devel.i686 libgcc.i686 libstdc++-devel.i686 ncurses-devel.i686  --setopt=protected_multilib=false

After that is done the -m32 switch must be added to the gcc compile statement.

gcc -o demoodbc -I../include demoodbc.c -L../lib -lodbc -lodbcinst -lpgicuXX -m32
Last Modified Date11/20/2020 6:53 AM
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.