Using Managed Connections


The DataFlex SQL Drivers support the use of Connection IDs to make it easier to store database server strings in a central location. The cConnection class integrates Connection ID support into the framework. The Studio and other DataFlex tools generate, maintain and use Connection IDs.

cConnection and Connection Ids

DataFlex has a cConnection class, which handles connections for drivers that support Connection IDs. We refer to this as using Managed Connections. Basically, this class, which is represented as a single global object, allows you to:

  1. Add Connection ID / Connection String pairs

  2. Use those Connection IDs in your table INT files

  3. Login to database servers via Connection IDs

  4. Make Embedded SQL (ESQL) connections  to servers via Connection IDs


The cConnection class provides a complete interface, which includes:


Managed Connections are fully supported in the Studio (and the other DataFlex tools) and are fully integrated into the DataFlex framework, and therefore your applications. Managed Connections greatly simplify deployment because server/database connections are defined and configured in a central location.

Login Credentials for Managed Connections in Web Applications

Windows Applications, by default, include a connection dialog (included via "Use DatabaseLoginDialog.dg"). Since Web Applications cannot display Windows dialogs and the DataFlex Web Application Service typically uses a different Windows user id than your Studio developer Windows user id, especially when deploying an application, we have added a Windows application template in the Studio under File > Create New > Project named "Managed Connection Login Project". This creates a small Windows application that allows you to set the credentials for Managed Applications. Once it has been run, you can then run a Web Application in the same workspace to use those credentials.


Next Topic

Defining a Connection


See Also

DataFlex SQL Drivers

Understanding How Connectivity Works

Connectivity and Development

Converting Data

Connecting to Existing Data

Using Embedded SQL

Connectivity Concepts