Configure database connection
- Last Updated: December 23, 2025
- 3 minute read
- OpenEdge
- Version 12.8
- Documentation
A properly configured OpenEdge project requires an active database connection and without it, essential features such as compilation and code completion are either limited or non-functional. This section focuses on enabling seamless integration between the development environment and a local OpenEdge database for a streamlined coding experience.
As an example, the following steps establish a connection to the sports2020
database by adding a dbConnections block to the
openedge-project.json file, enabling both compilation through the
AVM and code completion through the ABL language server using the associated schema
file:
- To enable database connectivity in your OpenEdge project, update the
openedge-project.jsonproject configuration file with the followingdbConnectionsblock:"dbConnections": [ { "name": "sp2k", "connect": "-db db/sports2020 -ld sp2k -RO", "schemaFile": "dump/sports2020.df", "aliases": ["sports"] } ]Note: TheschemaFileattribute is important for enabling code completion in the ABL Language Server. ABL Virtual Machine (AVM) handles compilation and requires an active database connection with the correct name and aliases. In contrast, code completion is powered by the Java-based language server, which does not connect to the database directly. Instead, it relies entirely on.dfdump files for schema awareness. To ensure consistent and reliable code completion, it is recommended to always include the database schema file in your code repository. - After updating the configuration, restart the ABL language server. You may encounter the following error at this stage:
OpenEdge client ended because it couldn't connect to a database.To investigate this error, navigate to .builder/clientlog0.log and review the log for specific error messages. For example, the following log output indicates that the local database is missing and needs to be created.Connecting to DB 'sp2k': '-db db/sports2020 -ld sp2k' Unable to connect to 'sp2k' ** Cannot find or open file C:\workspace\myProject\db\sports2020.db, errno = 2. (43) - To create and initialize database using Proenv:
- Open Visual Studio Code and switch to the Terminal tab.
- Click the ➕ icon to open a new terminal.
- Select Proenv from the dropdown.
The Proenv environment that matches the OpenEdge version of your project is automatically launched and initialized at the root directory of your project.
Within this environment, an Ant buildfile, which automates database creation is already configured and available. However, you can create your own xml file in the root of the project to configure database creation. Here is an example of the xml file:<?xml version="1.0" encoding="utf-8"?> <project name="myProject"> <property environment="env" /> <property name="DLC" value="${env.DLC}" /> <taskdef resource="PCT.properties"> <classpath location="${DLC}/pct/PCT.jar" /> </taskdef> <ProgressVersion dlcHome="${DLC}" fullVersion="dlc.version.full" /> <echo message="${dlc.version.full}" /> <PCTVersion /> <target name="db"> <mkdir dir="target/db" /> <PCTCreateDatabase sourceDB="${DLC}\sports2020" destDir="db" dbName="sports2020" dlcHome="${DLC}"/> </target> </project>After the Proenv terminal is active, run the following command to create theThis command creates thesports2020database in thedbdirectory:%DLC%\ant\bin\ant db\target\dbdirectory within your project to store the database files. It also sets up the foundational structure of the database in this location, making it ready for use by the AVM for compliation and language server for code completion through schema files.
- To validate compilation and code completion:
- Restart the ABL language server and modify
src/test1.p to include a reference to the
customertable. - Save and compile the file.
- Hover over the table name in a
FINDorFOR EACHstatement to view full table details and index usage. - Confirm that code completion is active for table and field names.
- Restart the ABL language server and modify
src/test1.p to include a reference to the