ODBC Pros and Cons

Top  Previous  Next

 

Using ODBC offers the following advantages:

·

ODBC is an excellent choice in a Client-Server environment, especially if the Server is a native Structured Query Language (SQL) DBMS. It lets you add Client-Server support to your application, without having to do much more than choose a file driver. ODBC was specifically designed to create a non-vendor-specific method of connecting front end applications to back end services. With ODBC, the Server can handle much of the work, especially for SQL JOIN and PROJECT operations, thereby speeding up your application.

·

Existing ODBC drivers cover a great many types of databases. There are ODBC drivers available for databases for which Clarion may not have a native driver--for example, for Microsoft Excel and Lotus Notes files.

·

ODBC is already widespread. Major application suites such as Microsoft Office install ODBC drivers for file formats such as dBase and Microsoft Access. Keep in mind that many ODBC back end drivers have been updated and you should obtain the latest releases.

·

ODBC is platform independent. One of Microsoft's prime objectives in establishing ODBC was to support easier access to legacy systems, or corporate environments where data resides on diverse platforms or multiple DBMS's. As long as an ODBC driver and back end are available, it doesn't matter whether you use Microsoft's NetBEUI, SPX/IPX, DECNet or others; your application can connect to the DBMS and access the data.

Given that there are many drivers available, and that the standard was developed by the company that developed Windows, you might consider using ODBC as the driver of choice for all your Windows applications. Yet, when deciding whether to use an ODBC driver or a Clarion native database driver, you must also consider possible disadvantages:

·

ODBC adds a layer--the ODBC Driver Manager--between your application and the database. When accessing files on a local hard drive, this generally results in slower performance. The driver manager must translate the application's ODBC API call to an SQL statement before any data access occurs.

·

ODBC uses SQL to communicate with the back end database. Although this can be very efficient when communicating with Client/Server database engines, it is normally less efficient than direct record access when using a file system designed around single record access, such as xBase or Btrieve.

·

The information required by the ODBC database manager to connect to a data source varies from one ODBC driver to another. Unlike the selection of Clarion file drivers, where file operations are virtually transparent, you may need to do some work to gather the information required to use a particular ODBC driver. This chapter provides a few tips that might make it easier.

·

ODBC is not included with Windows. When distributing your application, you'll need to install MDAC (Microsoft Data Access Components) into the end user's system, available for download at Microsoft’s web site.

Given the pros and cons, we recommend using the native Clarion file drivers when both a native driver and an ODBC driver exist for the same file format.