Tutorial: Build and Debug the Application

Requirements
Before attempting this tutorial, you must complete the following tutorials in the order listed:
  • Tutorial: Create a SQL Server Database
  • Tutorial: Create and Configure a Visual Studio Project
  • Tutorial: Set OpenESQL Assistant Configuration Options
  • Tutorial: Catalog a Connection
  • Tutorial: Build and Test a Query
  • Tutorial: Generate and Embed an SQL Program
  • Tutorial: Provide Additional Code
Add the Generated Copybook to the Project
While the OpenESQL Assistant generated and saved the copybook necessary to compile the application, it does not automatically add the file to the current project. The copybook must be part of the project to be included in the compiled application.
  1. From the Solution Explorer, right-click the OESQLAssistantTutorial project and select Add > Existing Item.
  2. Select EMP.cpy; then click Add.

    The EMP.cpy copybook is added to the project.

Add a Break Point
The program sends output to the console, and you want the application to pause at a point where you can see the output.
  1. In the COBOL Editor, scroll down to the following statement:
    EXEC SQL DISCONNECT CURRENT END-EXEC
  2. Place your cursor on the statement; then press F9 to toggle a break point.
  3. Click Save All (Save All) to ensure that everything in the project is up to date.
  4. Close any open tabs including the COBOL Editor and the OpenESQL Assistant.
Build the Application
  1. From the Solution Explorer, right-click the OESQLAssistantTutorial project and select Build.
Debug the Application
  1. Press F5 to start debugging.

    When execution reaches your breakpoint, Visual Studio places the query output into a console window.

  2. If the console is not visible, minimize the Visual Studio IDE. You should see the console output.
  3. Press F5 again to complete the debugging process.

This completes the OpenESQL Assistant tutorials.