ODBC (Open Database Connectivity, OpenDatabaseIs related to Microsoft's WOSA (Windows Open Services Architecture ).DatabaseIt establishes a set of specifications and provides a setDatabaseStandard API (Application Programming Interface ). These APIs use SQL to complete most of their tasks. ODBC also provides support for the SQL language. You can directly send SQL statements to ODBC. An ODBC-based applicationDatabaseDoes not rely on any DBMS, and does not directly deal with DBMS, allDatabaseThe operation is completed by the ODBC driver of the corresponding DBMS. That is to say, whether it is FoxPro, Access or OracleDatabaseWhich can be accessed using ODBC APIs. It can be seen that the biggest advantage of ODBC is that it can process allDatabase. A complete ODBC consists of the following components:
Application ).
ODBC Manager (Administrator ). The program is located in 32-bit ODBC on Windows 95 Control Panel. Its main task is to manage the installed ODBC driver and manage the data source.
Driver Manager ). The driver manager is included in ODBC32.DLL and transparent to users. Its task is to manage ODBC drivers and is the most important component in ODBC.
Odbc api.
ODBC driver. Is some DLL, providing ODBC andDatabase.
Data source. The data source containsDatabaseLocation andDatabaseType information is actually an abstraction of data connections.
The relationship between each part is shown in Figure 10.2.
0.2 ODBC component Diagram The application needs to accessDatabaseFirst, you must use the ODBC manager to register a data source.DatabaseLocation,DatabaseODBC driver and other information, establish ODBC and specificDatabase. In this way, as long as the application provides the data source name to ODBC, ODBC can be establishedDatabase. In ODBC, ODBC APIs cannot be accessed directly.Database, Must be passed through the driver manager andDatabaseExchange information. The driver manager is responsible for passing the application's odbc api call to the correct driver. After the driver completes the corresponding operation, return the result to the application through the driver manager. The ODBC driver is required to access the ODBC data source. You can use Visual C ++ 5.0 to install drivers such as SQL Server, Access, Paradox, dBase, FoxPro, Excel, Oracle, and Microsoft Text. by default, VC5.0 only installs drivers for SQL Server, Access, FoxPro, and dBase. if you need to install another driver, you need to re-run the installation program of VC 5.0 and select the required driver. |