Feedback
Did this article resolve your question/issue?

   

Article

How to setup a DSN-less connection string for the OpenEdge ODBC driver

« Go Back

Information

 
TitleHow to setup a DSN-less connection string for the OpenEdge ODBC driver
URL NameP97292
Article Number000140026
EnvironmentProduct: Progress
Version: 9.x
Product: OpenEdge
Version: All Supported Versions
OS: All Supported Platforms
Other: Progress OpenEdge ODBC drivers
Question/Problem Description
How to setup a DSN-less connection string for the OpenEdge ODBC driver.

How to setup the connection string for an ODBC DSN-less connection to a Progress database?

Is it possible to create an ODBC DSN-less connection to a Progress database?

How to connect to a database using just a driver instead of an ODBC DSN?

What is the connection string for a DSN-less connection?

What is the syntax of an ODBC Connect String?

How to configure the Default Isolation level string when connecting to an ODBC Driver without using an ODBC DSN?
 
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
It is possible to create a connection string to a Progress database to avoid using an ODBC DSN (Data Source Name). A DSN-less connection allows a user to connect to a database without an ODBC DSN being created on the server, thereby granting greater flexibility. DSN-less connections can be used from a variety of sources such as an ASP page or the Crystal Reports Designer and ActiveX runtime.

DSN-less Connection String:
DRIVER=<ODBC Driver Name>;HOST=<Hostname>;PORT=<Port>;DB=<Database Name>;UID=<Username>;PWD=<Password>;DIL=<DEFAULT ISOLATION LEVEL>

ODBC Driver Name
The name of the ODBC driver as it appears in Drivers tab of the Microsoft ODBC Data Source Administrator or in HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI


Hostname
The name (address) of the database server machine; the equivalent of -H.

Port
The port number of the host; the equivalent of -S.

Username
Name of the user establishing the connection

Password
Password of the user establishing the connection


Default Isolation Level -
OpenEdge ODBC driver version 6.0 and lower:
Specifies the Default Isolation Level for concurrent transactions. This parameter is case-sensitive and the value needs to be in upper-case. Possible values:

READ UNCOMMITTED
READ COMMITTED
REPEATABLE READ
SERIALIZABLE

Default Isolation Level - OpenEdge ODBC driver version 6.1 and higher:
Specifies the Default Isolation Level for concurrent transactions. Possible values:

0  (READ UNCOMMITTED)
1  (READ COMMITTED)
2  (REPEATABLE READ)
3  (SERIALIZABLE)

Samples:

Example of connection string for a specific provider:
myDSN="PROVIDER=MSDASQL:DRIVER={MERANT 3.60 32-BIT Progress SQL92 v9.1D};HOST=localhost;PORT=9999;DB=Sports2000;UID=sysprogress;PWD=sysprogress;DIL=READ UNCOMMITTED"

Examples of connection string for a specific ODBC driver:
  • DRIVER={DATADIRECT 4.10 32-BIT Progress SQL92 v9.1E};HOST=localhost;PORT=9999;DB=Sports2000;UID=sysprogress;PWD=sysprogress;DIL=READ UNCOMMITTED
  • DRIVER={Progress OpenEdge 10.1B driver};HOST=localhost;PORT=9999;DB=Sports2000;UID=myUser;PWD=myPassword;DIL=READ UNCOMMITTED
  • DRIVER={Progress OpenEdge 11.4 Driver};HOST=localhost;PORT=9999;DB=Sports2000;UID=myUser;PWD=myPassword;DIL=0
Note that the variable parts of the connection string do not have to be hard-coded. The string can be constructed by concatenating the fixed parts of the string with values set at run time. The following ABL code snippet constructs an OE 11.4 connection string containing host, port, database, username and password strings obtained at run time. Values for the variables might have been retrieved from a database, entered at the keyboard by an interactive user, or obtained in some other way. Most programming languages have a similar syntax for concatenating strings.
 
DEFINE VARIABLE cConnectionString AS CHARACTER NO-UNDO.
DEFINE VARIABLE cHost             AS CHARACTER NO-UNDO.
DEFINE VARIABLE cPort             AS CHARACTER NO-UNDO.
DEFINE VARIABLE cDb               AS CHARACTER NO-UNDO.
DEFINE VARIABLE cUser             AS CHARACTER NO-UNDO.
DEFINE VARIABLE cPassword         AS CHARACTER NO-UNDO.

...
/* Obtain run-time values and assign them to variables */
...

cConnectionString = 'DRIVER={Progress OpenEdge 11.4 Driver};HOST=' + cHost
                   + ';PORT=' + cPort
                   + ';DB=' + cDb
                   + ';UID=' + cUser
                   + ';PWD=' + cPassword'
                   + ';DIL=0'.
 
To test the connection string any OBDC clientcan be used. Examples can be found in the articles referred to in the Notes section.
Workaround
Notes
References to other documentation:

Progress Article(s):
 How to test an ODBC connection on Windows using PowerShell?
 Sample ASP Program to access Progress Database via SQL-92 Engine
 How to use a DSN-less connection with the Crystal Reports ActiveX Automation components in ABL
 SQL: Sample VB.NET code to establish a DSN-Less ( DSNless ) ODBC connection to an OpenEdge database.



The format of the Default Isolation Level (DIL) parameter changes between version 6.0 and 6.1 of the Progress OpenEdge ODBC Driver in order to align the Progress OpenEdge Driver with standard DataDirect settings.
Last Modified Date11/20/2020 7:19 AM
Attachment 
Files
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.