Source Code

In addition to using Actual ODBC Drivers with commercial applications such as FileMaker Pro and Excel, you can also create your own ODBC ready applications using most of the programming languages available today for Mac OS. To help you get started, we are providing a series of example implementations of a hypothetical application.

The application prompts the user for a DSN, user ID and password. The application assumes that the user has already configured a DSN with the ODBC Administrator. The application will provide a list of available DSN's if the given programming language supports it - otherwise it will prompt the user to type in the name of the DSN.

Once the user has pressed the Connect button, the application will attempt to connect to the database using the information from the given DSN. If the connection is successful, the application will perform a sequence of database operations: creating a table, inserting data into the table, fetching data from the table, and then dropping the table. The application will either display the data returned from the fetch operation, or it will display any error message returned if there was a problem.

All of these examples are public domain. You are free to use the code any way you wish. We do not require that you mention us as the provider of the code.

NOTE: these examples execute an INSERT statement, which is not yet supported by the Actual ODBC Driver for Access. The examples will work fine with all other Actual Technologies drivers.

 

Xcode / Carbon / C / C++

The Carbon example demonstrates how to link a Carbon Nib-based Mach-O application with the ODBC libraries that Apple includes with every copy of Mac OS since 10.2 Jaguar. This example can be easily modified to support a Cocoa / Objective-C implementation.

REALbasic 5.0 or later

The REALbasic example shows how to develop an application using the free ODBC Plugin. It requires the Professional version of REALbasic and the iODBC framework (included with Actual Technologies ODBC drivers).

PHP

The PHP example demonstrates how to create a single page web form that prompts the user for information and then performs an ODBC database task when the user submits the form. This example requires that PHP be configured to support ODBC as described in these instructions.