02ODBC basic concept

xiaoxiao2021-03-06  60

ODBC Basic Concept

ODBC (Open Database Connectivity) is an integral part of Microsoft's Open Services (WOSA, Windows Open Services Architecture) related to the database, which has established a set of specifications and provides a set of standards for database access. API (Application Programming Interface). These APIs utilize SQL to accomplish most of their tasks. The ODBC itself also provides support for SQL language, and users can directly send SQL statements to ODBC.

A ODBC-based application is not dependent on any DBMS, not directly dealing with DBMS, and all database operations are done by the corresponding DBMS ODBC driver. That is, whether it is FoxPro, Access is also an Oracle database, can be accessed with an ODBC API. It can be seen that the maximum advantage of ODBC is to process all databases in a unified manner.

A complete ODBC consists of several components:

Application. ODBC Manager (Administrator). This program is located within 32-bit ODBCs of the Windows 95 Control Panel, which main tasks are to manage installed ODBC drivers and manage data sources. Drive Manager. The driver manager is included in ODBC32.DLL, which is transparent to the user. Its task is to manage the ODBC driver, which is the most important part in ODBC. ODBC API. ODBC driver. It is some DLL, providing an interface between ODBC and databases. data source. The data source contains information such as database locations and database types, actually an abstraction of data connection.

The relationship between the components is shown in Figure 10.2

Figure 10.2 Relationship diagram of ODBC components

To access a database, you must first register a data source with the ODBC Manager. The Manager establishes the contact of the ODBC and the specific database based on the information provided by the database location, database type, and ODBC driver provided by the data source. In this way, as long as the application provides the data source name to ODBC, ODBC can establish a connection to the corresponding database.

In ODBC, the ODBC API cannot directly access the database, and information must be exchanged with database through the driver manager. The driver manager is responsible for transmitting the application to the correct driver to the ODBC API, and the driver is returned to the application by the driver manager after executing the corresponding operation.

Support for ODBC drivers when accessing ODBC data sources. Use the Visual C 5.0 installer to install SQL Server, Access, Paradox, DBASE, FoxPro, Excel, Oracle, and Microsoft Text and other drivers. By default, VC5.0 will only install SQL Server, Access, FoxPro, and DBASE drivers. If the user needs to install other drivers, you will need to re-run the VC 5.0 installer and select the desired driver.

转载请注明原文地址:https://www.9cbs.com/read-84771.html

New Post(0)