ODBC is a standard definition of an application programming interface (API) used to access data in relational or indexed sequential access method (ISAM) databases. Microsoft® SQL Server™ supports ODBC as one of the native APIs for writing C, C++, and Microsoft Visual Basic® applications that communicate with SQL Server. SQL Server Setup installs an ODBC driver for use with SQL Server when it installs the SQL Server client utilities.
ODBC defines a call-level interface, or CLI. A CLI is defined as a set of function calls and their associated parameters. A CLI definition uses a native programming language to call functions; therefore a CLI requires no extensions to the underlying programming language. This contrasts with an embedded API, such as Embedded SQL, where the API is defined as an extension of the source code for a programming language and applications using the API must be precompiled in a separate step.
ODBC aligns with the following specification and standard for relational SQL database CLI definitions:
While C, C++, and Visual Basic applications can be written to call ODBC directly, Microsoft also provides several APIs that map over ODBC. These APIs are simpler than ODBC itself, or offer improved integration with their respective programming languages:
While Visual Basic applications can be written directly to the ODBC API, they are usually written to either the RDO or DAO APIs.
SQL Server programs that are written using the ODBC API communicate with SQL Server through C function calls. The SQL Server-specific versions of the ODBC functions are implemented in a SQL Server ODBC driver. The driver passes SQL statements to SQL Server and returns the results of the statements to the application. ODBC applications are also interoperable with drivers for heterogeneous data sources.
The SQL Server version 7.0 ODBC driver complies with the Microsoft Win32® ODBC 3.51 specification. The ODBC function calls in this document use ODBC 3.51 syntax. The driver supports applications written with the ODBC 2.5 or earlier versions of the ODBC functions in the manner defined in the ODBC 3.51 specification.
ODBC enables a database to become an integral part of an application. SQL statements can be incorporated into the application, allowing the application to retrieve and update values from a database. Values from the database can be placed in program variables for manipulation by the application. Conversely, values in program variables can be written to the database.
ODBC enables applications to access a variety of data sources, including a wide range of relational databases and local ISAM data. ODBC supports applications in the Microsoft Windows®, Microsoft Windows NT®, and Windows 95/98 operating environments.
Tools for developing C and C++ applications using the ODBC API are available in the Microsoft ODBC Software Development Kit (SDK). The ODBC SDK is part of the Microsoft Developer Network (MSDN™) Professional subscription. The ODBC SDK can also be downloaded from http://www.microsoft.com/data, and is available in the Microsoft ODBC 3.0 Software Development Kit and Programmer’s Reference available from Microsoft Press®. The ODBC driver for SQL Server is included with SQL Server. Visual Basic includes all the components necessary to build applications using the RDO and DAO APIs. Visual C++ includes all the components necessary to build C and C++ applications using the DAO and MFC database classes.