Absent Member.
Absent Member.
1557 views

ODBC v ADO.NET

Jump to solution

[Migrated content. Thread originally posted on 28 November 2011]

Hi,

I use Visual Cobol and was just wondering if any one can advise if there any are advantages/disadvantages to setting the OpenESQL Assistant Mode to :-

1) ODBC
or
2) ADO.NET

Thanks

Neil.
0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert
The options in OpenESQL Assistant only refer to the syntax of the COBOL code that you would like to generate.
The compile directive SQL(DBMAN=ODBC) or SQL(DBMAN=ADO) refer to the underlying code that will be generated by the OpenESQL preprocessor.

If you specify ODBC then the underlying code will be generated to communicate with a specified ODBC driver using the DSN setup under the Windows ODBC Administrator.

If you specify ADO for managed code then the underlying code will be generated to communicate with a specified ADO.NET Data Provider such as SQL Server Native Client or Oracle ODP.NET.

If you are using native code then ODBC is the only option that you can use.

If you are using managed code and your database vendor has an ADO.NET Provider then you can use the DBMAN=ADO directive.

In addition to supporting the standard EXEC SQL statements supported by ODBC, you can also use EXEC ADO statements which allow you to work directly with ADO.NET objects such as Datasets and Tables. These objects support syntax for both connected model and disconnected model statements so that you can define ADO tables and Datasets that can be stored completely in-memory without the need for a physical database on disk.

This makes binding to GUI objects such as Grids and ListViews easy as you can bing the table or dataset directly to the .NET objects.

You can also share Connection objects and Dataset objects with programs written in other .NET languages such as C# or VB.NET.

If you are using managed code and your database supports it then you should use ADO in preference to ODBC as it was designed specifically for .NET applications.

For a list of EXEC ADO statements that are supported please see:

EXEC ADO Statements

View solution in original post

0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert
The options in OpenESQL Assistant only refer to the syntax of the COBOL code that you would like to generate.
The compile directive SQL(DBMAN=ODBC) or SQL(DBMAN=ADO) refer to the underlying code that will be generated by the OpenESQL preprocessor.

If you specify ODBC then the underlying code will be generated to communicate with a specified ODBC driver using the DSN setup under the Windows ODBC Administrator.

If you specify ADO for managed code then the underlying code will be generated to communicate with a specified ADO.NET Data Provider such as SQL Server Native Client or Oracle ODP.NET.

If you are using native code then ODBC is the only option that you can use.

If you are using managed code and your database vendor has an ADO.NET Provider then you can use the DBMAN=ADO directive.

In addition to supporting the standard EXEC SQL statements supported by ODBC, you can also use EXEC ADO statements which allow you to work directly with ADO.NET objects such as Datasets and Tables. These objects support syntax for both connected model and disconnected model statements so that you can define ADO tables and Datasets that can be stored completely in-memory without the need for a physical database on disk.

This makes binding to GUI objects such as Grids and ListViews easy as you can bing the table or dataset directly to the .NET objects.

You can also share Connection objects and Dataset objects with programs written in other .NET languages such as C# or VB.NET.

If you are using managed code and your database supports it then you should use ADO in preference to ODBC as it was designed specifically for .NET applications.

For a list of EXEC ADO statements that are supported please see:

EXEC ADO Statements

View solution in original post

0 Likes
Absent Member.
Absent Member.
Hi Chris,

Thanks for info.

I use the ODBC mode and because my databases are now getting quite large are there any tricks/tips to make retrieving data faster from the SQL database?

Kind regards

Neil.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.