Skip to main content

Hello,

I'm tryin to use the following statement in one of my managed Cobols:

EXEC ADO

   GET CONNECTION INTO :MyConnection

END-EXEC.

How should I declare the MyConnection field in my Cobol program.

I tried this:

01 MyConnection TYPE System.Data.SqlClient.SqlConnection.

But I get the following compiler error:

Error 1 COBES0100 : Incorrect SQL statement syntax near: xxxxx

Any ideas?

Hello,

I'm tryin to use the following statement in one of my managed Cobols:

EXEC ADO

   GET CONNECTION INTO :MyConnection

END-EXEC.

How should I declare the MyConnection field in my Cobol program.

I tried this:

01 MyConnection TYPE System.Data.SqlClient.SqlConnection.

But I get the following compiler error:

Error 1 COBES0100 : Incorrect SQL statement syntax near: xxxxx

Any ideas?

Define it as

01 myconnection   object.

You can then cast it to a different type after


Hello,

I'm tryin to use the following statement in one of my managed Cobols:

EXEC ADO

   GET CONNECTION INTO :MyConnection

END-EXEC.

How should I declare the MyConnection field in my Cobol program.

I tried this:

01 MyConnection TYPE System.Data.SqlClient.SqlConnection.

But I get the following compiler error:

Error 1 COBES0100 : Incorrect SQL statement syntax near: xxxxx

Any ideas?

The documentation show the following syntax:

          EXEC ADO

               GET CONNECTION INTO :myConnection  TRANSACTION INTO :myTransaction

          END-EXEC

This format works for me.