Choose an interface to access the ODBC driver

There are different programming interfaces that can be used with the IBM® i Access ODBC Driver. Each interface has its strengths and weaknesses.

Some of the more common programming interfaces are ActiveX Data Objects (ADO), ADO.NET, Rapid Application Development (RAD) tools, and ODBC APIs. The supported languages, reasons for using, and sources of more information for these interfaces, are provided below.

ActiveX Data Objects (ADO)

ADO refers to ActiveX Data Objects and is Microsoft's high level object model for data access.

  • Supported programming languages:
    • Visual Basic
    • Active Server Pages (ASP)
    • Delphi
    • Visual Basic Script
    • any other language or script that supports ActiveX or COM
  • Reasons to use this method:
    • Eliminates the coding of ODBC APIs
    • Supports switching providers, when needed
  • Where to go for more information:
    • More on how to use ADO, see the ADO documentation that comes in MDAC: www.microsoft.com/data/doc.htm
    • More on using the IBM i Access OLE-DB Provider through ADO refer to:IBM i Access for Windows OLE DB provider
  • Special notes:
    • To use ODBC through ADO an application needs to specify the MSDASQL provider in a connection string. MSDASQL converts ADO calls into ODBC API calls which communicate with the ODBC driver.
    • An example using an ADO connection string follows:

      ConnectionString = "Provider=MSDASQL;Data Source=MYODBCDS;"

ADO.NET

One of the newer programming technologies is Microsoft's .NET Framework. The ODBC driver can be used from a .NET application by using Microsoft's System.Data.Odbc .NET provider.

Rapid Application Development (RAD) tools

Rapid Application Development tools are tools that help in creating applications quickly. The tools make it so that the application writer does not have to know much about the ODBC specification.

  • Supported programming languages:
    • Depends on which RAD tool is used.
    • Some of the more commonly used tools include Powerbuilder, Delphi, and Seagate Crystal Reports.
  • Reasons to use this method:
    • Eliminates the coding of ODBC APIs
    • Works with multiple ODBC drivers using one program, with few or no changes
  • Where to go for more information:
    • Refer to the documentation included with the RAD tool.

Direct ODBC API calls

Direct ODBC API calls are when an application is written directly to the ODBC specification.

  • Supported programming language:

    C/C++

  • Reasons to use this method:
    • Allows direct control over which ODBC APIs are called so can be faster than using ADO objects or RAD tools
    • Designed to take advantage of driver-specific features
  • Where to go for more information:
    • For information on the ODBC specification and some samples see the ODBC documentation that comes in MDAC: www.microsoft.com/data/doc.htm.
    • For more information about driver-specific features see Implementation issues of ODBC APIs