Article

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

« Go Back

Information

 
Article Number000022406
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/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):
000074768, How to test an ODBC connection on Windows using PowerShell?
000001328, Sample ASP Program to access Progress Database via SQL-92 Engine
000011041, How to use a DSN-less connection with the Crystal Reports ActiveX Automation components in ABL
000014196, 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.
Attachment 
Last Modified Date7/10/2018 7:37 AM


Feedback
 
Did this article resolve your question/issue?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025