Set Up the OESQLAsst Project

Walks you through the steps required to create and configure a Visual Studio project to use for this tutorial.

Create a Visual Studio project

This tutorial requires that you create a COBOL project where you store, build, and run the COBOL application that you create later in this tutorial using the OpenESQL Assistant. In doing so, you use features available in the ADO.NET connection editor and the OpenESQL Managed Runtime.

  1. In Visual Studio, click File > New > Project.
  2. In the Create a new project dialog box, select COBOL from the Language drop-down list.
  3. Select Console Application (.NET Framework).
  4. Complete the fields as follows:
    Name OESQLAsst
    Location c:\tutorials\SQL
    Framework Choose the appropriate .NET Framework version from the drop-down list.
    Note: Must be .NET Framework 4.5 or higher.
  5. Check Place solution and project in the same directory.
  6. Click Create.

    Visual Studio creates a new solution and a project named OESQLAsst. The project contains one generic program, Program1.cbl, that you use in a later tutorial. If Visual Studio has automatically opened this file for editing, close it for now.

Set project properties

To compile this application such that it connects to the database via ADO.NET, you must set the project properties to include the DBMAN=ADO SQL compiler directive option. We must also set the BEHAVIOR compiler directive to provide optimal cursor behavior, including isolation level and lock concurrency settings.

  1. From the Solution Explorer, double-click Properties under your OESQLAssistantTutorial project.
  2. On the SQL tab, select OpenESQL from the ESQL Preprocessor drop-down list.
  3. Click Add.
  4. On the Available Directives list, click DBMAN; then click OK.
  5. Repeat steps 3 and 4, but this time add the BEHAVIOR directive.
  6. Back on the SQL tab, select BEHAVIOR on the Directives list.
  7. From the Value drop-down list, select ANSI.
  8. Click Save (Save); then close the Properties window.