10.14.1 Overview

ODBC (Open Database Connectivity) is a standard API for using a DBMS (DataBase Management System). By using ODBC you can access data from a multitude of DBMSs without having to know the details of each DBMS.

library(odbc) is a layer on top of ODBC. It has predicates for opening the database, starting and executing a query, and retrieving the results of a query. The ODBC client application, i.e. this library, accesses all ODBC functionality via a service provided by the operating system, the ODBC Driver Manager (DM).

Some operating systems (e.g. Mac OS X and MS Windows) usually come with an ODBC Driver Manager preinstalled. For other, UNIX and UNIX-like, operating systems, unixODBC (http://www.unixodbc.org) is the most common but Mac OS X use iODBC (http://www.iodbc.org).

The ODBC Driver Manager does not, in itself, provide any database functionality. Instead the DM loads a ODBC driver specific to the particular Database Management System (DBMS) (when odbc_db_open/[3,4,5] is called).

How to install and configure an ODBC driver is beyond the scope of this document. Please consult the documentation for the particular DBMS you intend to use. Some popular DBMSs are MySQL and PostgreSQL which both provide ODBC drivers for many platforms.

Send feedback on this subject.