Open Database Connectivity

Open Database Connectivity (ODBC) is a standardized API that provides universal database access and is available on all Windows systems.[1] It consists of a DLL that exposes standard functions to connect to and query databases, and a piece of software to manage connections. Each database vendor still has to provide the necessary software to connect to their own database, as well as an ODBC driver that allows it to fit into the ODBC framework. Click Start Settings Control Panel 32-bit ODBC to see the ODBC Data Source Administrator (see Figure 13.1).

ODBC Data Source Administrator
Figure 13.1. ODBC Data Source Administrator

Each machine provides a list of named data sources; these can be configured for a single user or available to the whole system. Clicking Add or Configure leads to a set of dialogs specific to the database vendor; for example, for a local Microsoft Access database you essentially just select the file to use. Once a data source has been defined, any of your programs can connect to that data source by name using ODBC.

This architecture has some enormous benefits. With care, it’s possible to start prototyping with a data source named "Accounts” on a local Access database, and then switch to using (for example) a remote Oracle server with the same structure just by changing the configuration.

Because the capabilities of databases vary so widely, the ODBC API offers a ...

Get Python Programming On Win32 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.