Skip to main content

i had no problem with sql syntax and i work a long time only with sql databases.

Now i want to change my conventional programs to access the sql database and all operations as oo cobol.
Do you have a little example to call this oo-methods? connect, select, insert, update, drop, etc

I want to program this showing the examples in VC6.0 and Netexpress 5.1, but become not a running program.

Thank you very much for any help!

i had no problem with sql syntax and i work a long time only with sql databases.

Now i want to change my conventional programs to access the sql database and all operations as oo cobol.
Do you have a little example to call this oo-methods? connect, select, insert, update, drop, etc

I want to program this showing the examples in VC6.0 and Netexpress 5.1, but become not a running program.

Thank you very much for any help!

here a attachment with my example

admlogin.cbl -> Start Program calling the oo program mysqlclass and the included methods 

hope to find a little help, that may be a cool development!


here a attachment with my example

admlogin.cbl -> Start Program calling the oo program mysqlclass and the included methods 

hope to find a little help, that may be a cool development!

There are examples of using SQL in managed .NET OO-COBOL within the Samples Browser. The first thing you must do is change your sql directive to use DBMAN=ADO instead of DBMAN=ODBC as .NET programs access SQL using ADO.NET providers and not ODBC drivers as ODBC is native technology.

Open the Samples browser and in the listbox at the top select Show .NET only and then in the lefthand column select SQL. Any of the OESQL examples would be a good starting place. There is additional syntax available using EXEC ADO statements that is supported when using ADO.NET. These can be seen in the examples for disconnected and connected models.


There are examples of using SQL in managed .NET OO-COBOL within the Samples Browser. The first thing you must do is change your sql directive to use DBMAN=ADO instead of DBMAN=ODBC as .NET programs access SQL using ADO.NET providers and not ODBC drivers as ODBC is native technology.

Open the Samples browser and in the listbox at the top select Show .NET only and then in the lefthand column select SQL. Any of the OESQL examples would be a good starting place. There is additional syntax available using EXEC ADO statements that is supported when using ADO.NET. These can be seen in the examples for disconnected and connected models.

Chris, since any days/weeks i show all this examples and after this i want to program my own program for see if y have anderstand oo cobol. I have no problem with sql syntax and prefer to use odbc then ado.
i have also read the documentation "Object-Oriented Programming for Cobol Developers" and use this information, but not very helpfull, to easy examples.
Can you show my little example and help me a little bit for oo.
Thanks

i had no problem with sql syntax and i work a long time only with sql databases.

Now i want to change my conventional programs to access the sql database and all operations as oo cobol.
Do you have a little example to call this oo-methods? connect, select, insert, update, drop, etc

I want to program this showing the examples in VC6.0 and Netexpress 5.1, but become not a running program.

Thank you very much for any help!

Hi

if not odbc or ado.

then it will be jvm code, you can use a jdbc connection or a jndi connection.

see this example it shows you how to do a jvm project with the jndi configuration needed.

/cobol/visualcobol/w/wikiid-120/25176/db2-jdbc-jndi-database-connection-with-visual-cobol-for-eclipse


Hi

if not odbc or ado.

then it will be jvm code, you can use a jdbc connection or a jndi connection.

see this example it shows you how to do a jvm project with the jndi configuration needed.

/cobol/visualcobol/w/wikiid-120/25176/db2-jdbc-jndi-database-connection-with-visual-cobol-for-eclipse

Sorry, my problem is not to connect to sql database and not the sql syntax for all operations. I have full working cobol programs since more then 20 years.

my new approach is to do this with oo cobol with class and methods as in the examples in visual cobol.

i need help only for correct oo syntax!


Sorry, my problem is not to connect to sql database and not the sql syntax for all operations. I have full working cobol programs since more then 20 years.

my new approach is to do this with oo cobol with class and methods as in the examples in visual cobol.

i need help only for correct oo syntax!

As you are not being specific about the OO syntax you are having issues with then the best thing I can do is recommend you have a read of the visual cobol book,

https://www.microfocus.com/en-us/about/visualcobolbook

https://www.microfocus.com/en-us/assets/application-modernization-and-connectivity/visual-cobol-book

 


As you are not being specific about the OO syntax you are having issues with then the best thing I can do is recommend you have a read of the visual cobol book,

https://www.microfocus.com/en-us/about/visualcobolbook

https://www.microfocus.com/en-us/assets/application-modernization-and-connectivity/visual-cobol-book

 

yes, i have read and work on this book and after this try to program my own application! And i am happy for my coding, but have any problems and need help to anderstand my failures.
But i see that on the forum many programmers have no experience with oo cobol.
i still continue my experimentation!

There are examples of using SQL in managed .NET OO-COBOL within the Samples Browser. The first thing you must do is change your sql directive to use DBMAN=ADO instead of DBMAN=ODBC as .NET programs access SQL using ADO.NET providers and not ODBC drivers as ODBC is native technology.

Open the Samples browser and in the listbox at the top select Show .NET only and then in the lefthand column select SQL. Any of the OESQL examples would be a good starting place. There is additional syntax available using EXEC ADO statements that is supported when using ADO.NET. These can be seen in the examples for disconnected and connected models.

Hi Chris,

i use the sqlbook.cbl from the samples directory.

with vc 3.0 also vc6.0 upd4 the source code gives errors:

COBCH0014 invalid operation

MSB4181 

see png attached

thank you for help!


Hi Chris,

i use the sqlbook.cbl from the samples directory.

with vc 3.0 also vc6.0 upd4 the source code gives errors:

COBCH0014 invalid operation

MSB4181 

see png attached

thank you for help!

You changed the directives at the top of the source and are using invalid directives for managed .NET code.

What happens if you only use:

$set sql(dbman=ado, behavior=optimized)


You changed the directives at the top of the source and are using invalid directives for managed .NET code.

What happens if you only use:

$set sql(dbman=ado, behavior=optimized)

Chris, do you have test this?
when i use only the original set directive, i become 13 errors!
COBCH00012 operand .... not declared
COBES0023 the sql(dbman) directive is not allowed in native....

Hi Chris,

i use the sqlbook.cbl from the samples directory.

with vc 3.0 also vc6.0 upd4 the source code gives errors:

COBCH0014 invalid operation

MSB4181 

see png attached

thank you for help!

Yes it works fine but this program is meant to be compiled as part of the sample solutions/projects that are provided in the Samples browser. There are additional directives that are being set at the project->Properties level under the COBOL tab.

I suggest that you open the samples browser and open the Solution for OESQL- WPF Book (.NET/VS)

This uses this program in the project OOSqlLegacyBook.

You do not use ODBC when you are compiling for .NET. You use DBMAN=ADO and you need to set up an ADO Provider DSN using the ADO Connection Editor.

Please read thru the Readme in the Sample mentioned above as it provides you with the instructions.

 


Yes it works fine but this program is meant to be compiled as part of the sample solutions/projects that are provided in the Samples browser. There are additional directives that are being set at the project->Properties level under the COBOL tab.

I suggest that you open the samples browser and open the Solution for OESQL- WPF Book (.NET/VS)

This uses this program in the project OOSqlLegacyBook.

You do not use ODBC when you are compiling for .NET. You use DBMAN=ADO and you need to set up an ADO Provider DSN using the ADO Connection Editor.

Please read thru the Readme in the Sample mentioned above as it provides you with the instructions.

 

I would also add the demo was never written to be used in native code because the OO syntax it uses is only available in managed code


I would also add the demo was never written to be used in native code because the OO syntax it uses is only available in managed code

Are you sure for your opinion for oo cobol?
i know many developper using oo Cobol since long time in conventional cobol programs!

Are you sure for your opinion for oo cobol?
i know many developper using oo Cobol since long time in conventional cobol programs!

I am pretty sure.. the syntax used is managed code only.

I even tried changing it to the old style invokes and it compiled without error.

My recommendation is to stick with the managed code when working with OO.