C

Look in this section for example-based C tutorials that introduce you to ODBC API programming in C. Each tutorial contains C ODBC code samples that illustrate database access tasks such as establishing an ODBC connection, generating result sets, and fetching the results.

You'll need an ODBC driver to work through the examples in our C programmer ODBC guides.

ODBC from C tutorial part 1 — getting started

How to use ODBC from the C programming language. This introductory tutorial explains how to create handles, connect to an ODBC data source, and use the basic result-set generating ODBC functions. The tutorial provides C code samples that illustrate each technique it introduces along with a sample program that shows how to retrieve information from a database. Finally, the tutorial shows how to retrieve any diagnostic information or errors returned by an ODBC function.

ODBC from C tutorial part 2 — fetching results

Expands on the basic process for fetching results by introducing techniques such as binding result set columns, retrieving data from unbound columns, and returning multiple rows of data.

ODBC code samples

ODBC API examples written in C.