Home » Database Basics » 09 - Database Programming - ODBC and the Web
9

ODBC

Open Database Connectivity

ODBC stands for open database connectivity. It is a way to share data irrespective of the DBMS used. That is, using ODBC, data can pass between the database and the next layer irrespective of whether the DBMS used is ORACLE, MS SQL SERVER, DB2 or any other. Also, if you have a program that gets data from a SQL Server database, ODBC allows you to use the same program to access data from a Visual FoxPro database. To do this, you must add software components called drivers to your computer and configure data sources for this driver. ODBC identifies each data source by a name; you just have to use this name in your program. The name refers to an actual database on a DBMS. So, to switch DBMS, all you have to do is configure the data source name to point to some other database; ODBC drivers will do all the other translation. You do not have to change your programs in any way.

Screen Shot 9a: Some ODBC drivers that come with Windows XP
Screen Shot 9a: Some ODBC drivers that come with Windows XP

ODBC drivers are used along with ODBC to speak to different types of databases. That is, a certain driver will speak to a PARADOX database while another will speak to a DB2 database and so on. Drivers that are appropriate for your DBMS have to be downloaded and installed on your system. Some drivers just handle passing the Data sources back and forth - these are called single tier drivers - each DBMS translates its data and communicates the data to the driver. Other drivers (multiple tier drivers) contain built-in programs that communicate and get data from different DBMS.

Figure 9b: Single vs. Multiple Tier ODBC Drivers
Figure 9b: Single vs. Multiple Tier ODBC Drivers