How ODBC Works

Top  Previous  Next

 

When you use ODBC to access data, four components must cooperate to make it work:

1.

Your application calls the ODBC driver manager, and sends it the appropriate requests for data, with the ODBC API.

Clarion does this for you transparently, using the ClaODB.DLL (32-bit) application extension. When hand-coding, be sure to include this library in the project. When distributing your application, be sure to deploy this file with your .EXE file (unless you produce a one-piece .EXE).

2.

The ODBC driver manager receives the API calls, check the Windows Registry for information on the data source, then loads the ODBC "back-end" driver.

The actual "interface" to the driver manager is a file called ODBC32.DLL, which the Microsoft setup program places in the \Windows\System directory. This is the ODBC Administrator, which then loads other libraries to do its work.

3.

The ODBC "backend" driver is another library (.DLL) which contains the executable code for accessing the data.

Various third-parties supply "backend" drivers. For example, Lotus Development Corp. supplies the ODBC driver for Lotus Notes. Microsoft Office distributes an ODBC SDK containing drivers for most of their database products.

4.

The data source is either a data file (usually when ODBC is used for local data access), or a remote DBMS, such as an Oracle database.

The data source has a descriptive name; for example, "Microsoft Access Databases." The name serves as the section name in the ODBC.INI file.

The ODBC driver manager must know the exact data source name so that it can load the right driver to access the data. Therefore, it's vitally important that you know the precise data source name.