ODBC is an acronym for ‘Open DataBase Connectivity’. It is a standard first developed by Microsoft for accessing data in both relational and non-relational database management systems, based on the X/Open and ISO/IEC Call-Level Interface (CLI) specifications for database APIs and the Structured Query Language (SQL) specification for database access languages. The ODBC standard is widely used by all major database vendors. Databases driven by database engines include Oracle, Microsoft SQL Server, Sybase, Informix and DB2, while you also get a lot of so-called ‘flat-file’ databases with no stand-alone database engines, such as Microsoft Access, dBase, Paradox and BTrieve. All these and other databases can be accessed via ODBC.
Why was ODBC created? You need a way to communicate with a database and transfer data to and from a database, as well as perform some queries on the data in the database. The problem is that each database vendor has his own set of methods (called an API) to perform all these functions. So, if you write an application which for example uses the Oracle API, that same application can’t be used to access a SQL Server database, since the API’s of Oracle and SQL Server are different. So you have to duplicate all your code if you want to access two different databases from the same application. Imagine if you want to access 5 or 10 different databases!
Now this is where ODBC comes into the picture and makes life a whole lot easier for you. ODBC is an API that allows you to talk to any database you want. Instead of writing a data access application using a specific database API, such as Oracle’s, you can now write your application using the ODBC API, which can perform virtually any function that you can do with the Oracle API. The best part is that now you can use the same code to access any other database too! How is this possible? Well, ODBC is basically a very thin layer between your application and the database API. It makes use of an ODBC driver to access a specific database. An ODBC driver is basically a DLL which maps each function in the ODBC API to similar functions in the API of the specific database the driver was written for. For example, the Oracle ODBC driver maps the ODBC API into the Oracle API. Each database has its own ODBC driver or drivers, written either by the database vendor or a third-party ODBC driver vendor.