ODBC Connectivity
by Brian Ripley
Department of Statistics, University of Oxford
ripley@stats.ox.ac.uk
March 9, 2012
Package RODBC implements ODBC database connectivity. It was originally
written by Michael Lapsley (St George’s Medical School, University of Lon-
don) in the early days of R (1999), but after he disappeared in 2002, it
was rescued and since much extended by Brian Ripley. Version 1.0-1 was
released in January 2003, and RODBC is nowadays a mature and much-used
platform for interfacing R to database systems.
1 ODBC Concepts
ODBC aims to provide a common API for access to SQL
1
-based database
management systems (DBMSs) such as MySQL, PostgreSQL, Microsoft Ac-
cess and SQL Server, DB2, Oracle and SQLite. It originated on Windows
in the early 1990s, but ODBC driver managers unixODBC and iODBC are
nowadays available on a wide range of platforms (and a version of iODBC
ships with recent versions of Mac OS X). The connection to the particular
DBMS needs an ODBC driver : these may come with the DBMS or the
ODBC driver manager or be provided separately by the DBMS developers,
and there are third-party
2
developers such as Actual Technologies, Easysoft
and OpenLink. (This means that for some DBMSs there are several different
ODBC drivers available, and they can behave differently.)
Microsoft provides drivers on Windows for non-SQL database systems such
as DBase and FoxPro, and even for flat files and Excel spreadsheets. Actual
Technologies sell a driver for Mac OS X that covers (some) Excel spread-
sheets and flat files.
A connection to a specific database is called a Data Source Name or DSN
1
SQL is a language for querying and managing data in databases—see http://en.
wikipedia.org/wiki/SQL.
2
but there are close links between unixODBC and Easysoft, and iODBC and OpenLink.
1
- 1
- 2
- 3
- 4
前往页