Archive for June, 2009

Connecting to an ODBC Data Source of Driver

An application can be connected to any number of drivers and data sources. These can be a variety of drivers and data sources, the same driver and a variety of data sources, or even multiple connections to the same driver and data source.
Allocating the Environment Handle

The first task for any ODBC application is to load [...]

Transactions ODBC

A transaction is a unit of work that is done as a single,atomic operation; that is, the operation succeeds or fails as a whole. For example, consider transferring money from one bank account to another. This involves two steps: withdrawing the money from the first account and depositing it in the second. It is important [...]

Basic ODBC Application Steps

Step 1: Connect to the Data Source
The first step in any application is to connect to the data source. This phase, including the functions it requires, is shown in the following illustration.
The first step in connecting to the data source is to load the Driver Manager and allocate the environment handle with SQLAllocHandle. For more [...]

ODBC Data Source Example

On computers running Microsoft® Windows NT® Server/Windows 2000 Server, Microsoft Windows NT Workstation/Windows 2000 Professional, or Microsoft Windows® 95/98, machine data source information is stored in the registry. Depending on which registry key the information is stored under, the data source is known as a user data source or a system data source. User data [...]

Using ODBC Data Sources

Data sources usually are created by the end user or a technician with a program called the ODBC Administrator. The ODBC Administrator prompts the user for the driver to use and then calls that driver. The driver displays a dialog box that requests the information it needs to connect to the data source. After the [...]

Types of ODBC Data Sources

Machine data sources are stored on the system with a user-defined name. Associated with the data source name is all of the information the Driver Manager and driver need to connect to the data source. For an Xbase data source, this might be the name of the Xbase driver, the full path of the directory [...]

ODBC Driver Types

File Based Driver
File-based drivers are used with data sources such as dBASE that do not provide a stand-alone database engine for the driver to use. These drivers access the physical data directly and must implement a database engine to process SQL statements. As a standard practice, the database engines in file-based drivers implement the subset [...]

ODBC Driver Tasks

Specific tasks performed by drivers include:

Connecting to and disconnecting from the data source.
Checking for function errors not checked by the Driver Manager.
Initiating transactions; this is transparent to the application.
Submitting SQL statements to the data source for execution. The driver must modify ODBC SQL to DBMS-specific SQL; this is often limited to replacing escape clauses defined [...]

Driver Manager

The Driver Manager is a library that manages communication between applications and drivers. For example, on Microsoft® Windows® platforms, the Driver Manager is a dynamic-link library (DLL) that is written by Microsoft and can be redistributed by users of the redistributable MDAC 2.8 SP1 SDK.
The Driver Manager exists mainly as a convenience to application writers [...]

ODBC Applications

An application is a program that calls the ODBC API to access data. Although many types of applications are possible, most fall into three categories, which are used as examples throughout this guide.
* Generic Applications These are also referred to as shrink-wrapped applications or off-the-shelf applications. Generic applications are designed to work with a variety [...]