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 will need an ODBC driver to work through the examples in our C programmer ODBC guides. We used the Easysoft ODBC-ODBC Bridge with Microsoft SQL Server and Microsoft Access databases to test the C examples. We also tested the C code samples with our Oracle, SQL Server, Salesforce.com, MongoDB, DB2, Derby, Sybase, InterBase, Firebird and ISAM drivers. By registering with us, you can download a free trial version of the Easysoft ODBC driver for your database platform.
Tutorials and Resources
- ODBC from C Tutorial Part 1
- 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.