Takes you through the process of creating a
Visual COBOL database project to use as you complete the remainder of these tutorials.
- Requirements
- Before attempting this tutorial, you must complete the following tutorials in the order listed:
- Tutorial: Enable SQL CLR Integration
- Tutorial: Create a Sample Database
- Phase 1: Launch
Visual COBOL
for Visual Studio 2015
-
- Click
Start > All Programs > Micro Focus Visual COBOL > Visual COBOL for Visual Studio 2015.
Note: On UAC-enabled operating systems, you must start
Visual COBOL as an administrator.
On Windows 8 and Windows Server 2012, you use the Start screen to invoke programs.
- Phase 2: Create a New Database Project
-
The SQL CLR Integration feature in
Visual COBOL
for Visual Studio 2015 provides a project template named
SQL Server Database Project, which is configured specifically for SQL CLR. Here, you create a Visual Studio project based on this template.
- From the Visual Studio IDE, click
.
- Under
Installed Templates, click
COBOL >
Database.
- From the drop-down list above the list of templates, select a .NET Framework to use.
- Click
SQL Server Database Project.
- In the
Name field, type
SQLCLRTutorial.
- In the
Location field, specify a directory in which to store the project; then click
OK.
Visual Studio creates a solution containing two projects: a COBOL project named
SQLCLRTutorial, and a publishing project named
SQLCLRTutorial.Publish. The
.Publish project references the COBOL project.
- Phase 3: Set Project Properties
-
- From the Solution Explorer, double-click
Properties under your
SQLCLRTutorial COBOL project.
- On the
SQL tab, select
OpenESQL from the
ESQL Preprocessor drop-down list; then click
Add.
- On the
Available Directives list, click
DBMAN.
- From the
Value drop-down list, select
ADO; then click
OK.
- Click
Add again.
- On the
Available Directives list, click
BEHAVIOR.
- From the
Value drop-down list, select
MAINFRAME; then click
OK.
- On the
COBOL tab, set the
Warning level to
Include recoverable errors (Level E).
- Open the project properties for the
.Publish project.
- On the
Project Settings tab, set the
Target Platform to the version of Microsoft SQL Server that you are using.
- On the
Debug tab, click the
Edit button associated with
Target Connection String.
- In the
Server Name field, type
. (dot) to indicate the local SQL Server instance.
- In the
Select or enter a database name field, select
SQLCLR_Test; then click
OK.
- Click
Save, and close the Properties window.
- Phase 4: Set OpenESQL Assistant Options
-
- From the Visual Studio IDE, click
Tools > Options >
Micro Focus Visual COBOL > OpenESQL Assistant.
- In the
Qualify table with owner name field, click the drop-down list and select
True.
- In the
Type Stored Procedure field, select
SQLCLR; then click
OK.
This concludes this tutorial. Please continue with
Tutorial: Create an ADO.NET Connection or
Tutorial: Generate a COBOL Wrapper for a SQL CLR Stored Procedure.