Differences between ODBC, ole db, and ADO

Source: Internet
Author: User
Tags ole

 

I. ODBC

  • ODBC Origin

In 1992, Microsoft, Sybase, and digital jointly developed the ODBC standard interface to access different databases with a single odbc api. Later, ODBC was supported by many database vendors and third-party, and gradually became a standard data access technology.
ODBC supports a wide range of databases with the Industrial Standard Specification x/opencall-levelinterface (CLI) and ISO/IEC9075-3Call-LevelInterface (SQL/CLI) at that time. Although ODBC is inefficient and has limited functionality in earlier versions, it is also devalued. However, with the continuous improvement of ODBC by Microsoft, the execution efficiency of ODBC is increasing, and the functions of ODBC drivers are becoming more and more complete. ODBC is a stable and efficient data access engine. However, ODBC only supports relational databases and traditional database data types, and only uses C/C ++ language APIs (APIs are some C language code and are the underlying programs, in Windows. DLL files) to provide services, so it cannot meet the increasingly complex data access applications, nor can it be used by the scripting language. Therefore, Microsoft has introduced other data access technologies in addition to ODBC to meet different needs of programmers. (Note: ODBC is a process-oriented language developed by C language and cannot be compatible with multiple languages. Therefore, it is difficult to develop and only supports limited database companies, it is not supported by later Excel files)

  • ODBC Introduction

ODBC (Open Database Connectivity) is an open service structure (wosa, windows open
Services Architecture), which establishes a set of specifications and provides a set of standard APIs for database access (application programming interfaces ). 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.

To access a database, an application must first register a data source using the ODBC Manager. The manager registers a data source based on the database location, database type, ODBC driver, and other information provided by the data source, establish a connection between ODBC and a specific database. In this way, as long as the application provides the data source name to ODBC, ODBC can establish a connection with the corresponding database.


Ii. OLE DB

  • The origin of OLE-DB

As data sources become increasingly complex, today's applications may need to obtain and process data from different data sources, and then output the processed data to another data source. What's more troublesome is that these data sources may not be traditional relational databases, but may be Excel files, emails, and electronic signature information on the Internet/Intranet. Microsoft allows applications to access different numbers in a unified manner
Data sources proposed the universaldataaccess (UDA) architecture in 1997. With COM technology as the core, uda helps programmers access various data sources in the enterprise. UDA uses OLE-DB (software at the operating system level) as the technical skeleton. The OLE-DB defines a unified COM interface as the standard to access various heterogeneous data sources, and is encapsulated in a group of COM objects. With OLE-DB, programmers can access a variety of data in a consistent way. However, oledb is still low-level and inefficient at utilization.

  • Introduction to OLE-DB

Ole db (Object link and embed .) It is Microsoft's strategic low-level application interface to different data sources. Ole
DB not only includes the structured problem language (SQL) capability of Microsoft-funded standard data interfaces Open Database Connectivity (ODBC), but also supports other non-SQL data types. As a design of Microsoft's Component Object Model (COM), ole db is a set of methods for reading and writing data (which may have been called a channel in the past ). Objects in old dB mainly include data source objects, stage objects, command objects, and row group objects. Applications using ole db use the following request sequence: Initialize OLE to connect to the data source and issue a command to release the data source object and stop OLE initialization.

The new concept defined in the ole db standard-ole db divides traditional database systems into multiple logical components, which are relatively independent and communicate with each other. Each part of this component model has a different name: data provider ). Software components that provide data storage, ranging from common text files to complex databases on hosts or email storage, are examples of data providers. Some documents refer to developers of these software components as data providers.

To enable data in an Access database, you must use ADO. Net to enable it through ole db. Ado. net uses ole db to obtain data. This is because ole db understands how to communicate with many data sources, so it is very important to have a considerable understanding of ole db.

 

  • OLE DB
    Differences from ODBC

Because oledb and ODBC are both designed to provide a unified interface for accessing data, some people once wondered: Does ole db replace the New ODBC standard? The answer is no. In fact, ODBC standard objects are SQL-based data sources, while Ole
DB objects are more extensive data storage. In this sense, ODBC-compliant data sources are a subset of ole db-compliant data storage.

Iii. Ado

  • The origin of ADO

Although OLE-DB allows programmers to access all kinds of data, is a very good architecture, but because the OLE-DB is too low-level, and in the use of very complex, need programmers with superb skills, therefore, only a few programmers can use OLE-DB. This makes OLE-DB less popular. To solve this problem and allow the VB and scripting languages to access various data sources through OLE-DB, Microsoft also encapsulates OLE-DB as ADO objects with COM technology (this step is important, A variety of programs can be tuned to each other, and a variety of languages can be developed) Simplifies the programmer's data access work. Because
Ado successfully encapsulates most of the functions of the OLE-DB, and greatly simplifies the data access work, So ADO is gradually accepted by more and more programmers.

  • Introduction to ADO

Microsoft's ActiveX Data Objects (ADO) is a COM component used to access data sources. It provides an intermediate layer for programming languages and Unified Data Access to ole db. Allow developers to write data access code without having to worry about how the database is implemented, rather than the connection to the database. When accessing a database, the knowledge about SQL is not necessary, but the SQL commands supported by a specific database can still be executed through the command objects in ADO.

Ado was designed to inherit from Microsoft's early Data Access Object layers, including rdo (Remote dataobjects) and Dao (data access objects ). Ado was released in the winter of 1996.

Ado includes six classes: connection, command, recordset, errors, parameters, and fields.

  • Talk about your understanding

In layman's terms, ole db and ODBC are at the bottom layer, while ADO objects provide us with a "Visualization" component that interacts directly with the application layer, we don't need to pay too much attention to the internal mechanism of oledb. We only need to know several methods of creating data sources through ole db in ADO, so that we can easily obtain data sources through ADO. It can be said that ADO is an intermediate layer between applications and data. The ADO object uses Ole
The database indirectly acquires data in the database. Ole db only provides a common interface to various databases, which can be simply used to represent:

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.