In this tutorial, you create
a Visual Studio Managed COBOL project to use as you complete the remainder of these tutorials.
- Requirements
- Before attempting this tutorial, you must complete
Tutorial: Create a SQL Server Database.
- Launch
Enterprise Developer
for Visual Studio 2019
- This procedure varies depending on your Windows version. If you need instructions, see
To start
Enterprise Developer.
- Create a New COBOL Project
- In this set of tutorials, you create a COBOL application
to take advantage of the features available in the ADO.NET connection editor, and the OpenESQL
Managed Runtime.
- In Visual Studio, click
.
- In the
Create a new project dialog box, select
COBOL from the
Language drop-down list.
- Select
Console Application (.NET Framework).
- Complete the fields as follows:
Name
|
OESQLAssistantTutorial
|
Location
|
Full path to a directory in which to store the project
|
Solution Name
|
OESQLAssistantTutorial
|
Framework
|
Choose the appropriate .NET Framework version from the drop-down list.
Note: Must be .NET Framework 4.5 or higher.
|
- Click
Create.
Visual Studio creates a new
solution and a
project named
OESQLAssistantTutorial.
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.
- From the Solution Explorer, double-click
Properties under your
OESQLAssistantTutorial project.
- On the
SQL tab, select
OpenESQL from the
ESQL Preprocessor drop-down list.
- Click
Add.
- On the
Available Directives list, click
DBMAN; then click
OK.
- Repeat steps
3 and
4, but this time add the
BEHAVIOR directive.
- Back on the
SQL tab, select
BEHAVIOR on the
Directives list.
- From the
Value drop-down list, select
ANSI.
- Click
Save (); then close the Properties window.