The difference between Ado,oledb,odbc,dao

Source: Internet
Author: User
Tags dsn odbc connection ole

ODBC(Open database Connectivity, opening databases interconnect)

In 1992, Microsoft's Open Services Architecture (Wosa,windows Open service Architecture), a component of the database, established a set of specifications and provided a set of standard APIs (application programming interfaces) for database access. These APIs use SQL to accomplish most of their tasks. ODBC itself also provides support for the SQL language, which allows users to send SQL statements directly to ODBC. ---appear the earliest, but not always omnipotent.

DAO(data Access Object)

In 1993, Microsoft was used to expose the Microsoft Jet database engine, which was first used by Microsoft Access and now supports other databases, and allows developers to connect directly to an Access table, just as they would directly connect to other databases via ODBC. DAO is best used for single-system applications or for small-scale local distribution. Its internal access to the Jet database has been accelerated, and it is easy to use. So if the database is an Access database and is used locally, it is recommended to use this access method---the specificity of the application


RDO(Remote Data Objects)

In 1995, RDO was an ODBC-based, object-oriented data access interface that, combined with an easy-to-use DAO style, provided an interface that formally demonstrated the underlying functionality and flexibility of all ODBC. Although RDO is constrained in accessing the Jet or ISAM database well, it can only access the relational database through the existing ODBC driver. However, RDO has proven to be the best interface that many SQL Server, Oracle, and other large relational database developers often choose. RDO provides more and more complex objects, properties, and methods for accessing stored procedures and complex result sets. ---is undoubtedly based on the ODBC


OLE DB(Object Linking and embedding, database, objects connected to embedded databases)

In 1997, Microsoft had a strategic system-level programming interface for managing data across the organization. OLE DB is an open specification built on top of the ODBC functionality. ODBC is specifically developed for accessing relational databases, and OLE DB is used to access relational and non-relational sources of information, such as host Isam/vsam and hierarchical databases, e-mail and file system storage, text, graphics and geographic data, and custom business objects.

OLE DB defines a set of COM interfaces that encapsulate various database management system services and allow the creation of software components to implement those services. OLE DB components include data providers (containing and performing data), data consumer (usage data), and service components (processing and transmitting data, such as query processors and cursor engines).
OLE DB interfaces help to integrate components smoothly, so that OLE DB component vendors can quickly deliver high-quality OLE DB components to the market. In addition, OLE DB contains a "bridge" that connects to ODBC, providing consistent support for the various ODBC-relational database drivers that are currently in use. ---claims to replace ODBC, but also compatible with ODBC

ADO(ActiveX data object, active Data Objects)

In the 1996, ADO was the successor of Dao/rdo. ADO 2.0 is functionally more similar to RDO, and in general, there is a similar mapping between the two models. ADO "Extends" the object model used by DAO and RDO, which means that it contains fewer objects, more properties, methods (and parameters), and events. As the latest database access mode, ADO is also easy to use, so Microsoft has made it clear that the future focus on ADO, Dao/rdo no longer upgrade, so ADO has become the mainstream of current database development. ADO involves data storage with DSN (data source name), ODBC (Open data Connection), and OLE DB three methods. The following routines will explain in detail the specific access implementations of these three ways. ---can be said to be the odbc,oledb of these system-level programming interfaces, and Dao,rdo these application-level programming interfaces to upgrade it.

ODBC, DAO, ADO, OLE DB database connection mode difference and contact

ODBC is a low-level access technology, so the ODBC API can be a client application from the underlying settings and control of the database, some advanced database technology can not be completed, but the shortcomings of ODBC can only be used in relational databases, Makes it difficult to access object databases and other non-relational databases with ODBC.

DAO provides a mechanism for creating and manipulating databases through program code. The most significant feature is the ease of operation of the Microsoft Jet database and one of the best performing technology interfaces when working with Jet databases. And it is not only used to access this kind of database, in fact, through DAO technology can access from text files to large back-end database and other data formats.

ADO is an OLE DB-based provider that is an object-oriented OLE DB technology that inherits the benefits of OLE DB. A high-level interface that belongs to database access.


noun Explanation:

ODBC (Open database Connectivity) Open databases interconnect. Is the Microsoft-led database link standard.

MFC (Microsoft Foundation Class) Microsoft base class. MFC ODBC is the encapsulation of ODBC.

A DAO (data access object) that accesses objects. Remote access functionality is not available.

RDO (Remote Data Object) Remoting object. Fast, supporting SQL Server stored procedures, like DAO, is a technology that has evolved over the years.

Ole-db (Object Linking and Embedding database) objects are linked and embedded. It relies on COM and SQL that provides the vendor of the OLE DB provider rather than ODBC.

The ADO (ActiveX Data Object) ActiveX object. Local and remote database access technologies based on OLE-DB to establish connections. Be "Young" as ole-db.

in use, we generally replace DAO and RDO with Ole-db and ADO.

The relationship between ADO and OLE DB

OLE DB is an interface for the underlying data access interface. is used for third-party driver merchants to develop an application that outputs data sources to ado-technology or developers of C + + to develop customized database components.

OLE DB is an important system-level programming interface for accessing data, which is the underlying technology of ADO, and it is also an ADO data source.

ADO is an OLE DB-based provider that is an object-oriented OLE DB technology that inherits the benefits of OLE DB. A high-level interface that belongs to database access.

As you can say, ADO provides high-level application API functions for OLE DB.



How to connect various data interfaces

One, ADO connection
1. Connect to an Access database
Set Conn=server.createobject ("ADODB. Connection ")
Conn.Open "Driver={microsoft Access Driver (*.mdb)};d bq=" &server.mappath ("dbname (path full name)")
2. Connecting to the SQL Server database
Set Conn=server. CreateObject ("ADODB. Connection ")
Sql= "Driver={sql server};server= (local); Uid=sa;pwd=sa;database=dbname"
Conn.Open (SQL)

Ii. ODBC connection (data source---DSN must be registered first)
(List configure SQL Server database file DSN, open Administrative Tools---data source (ODBC)---Open the System DSN tab---Click the Add button---Select SQL Server from the list, click Finish---Enter the name of the database in the name of the SQL you want to connect to Server server input (local)---Follow the wizard prompts)
1. Connect to an Access database
Set conn = Server.CreateObject ("ADODB. Connection ")
Conn. Open "dsn= registered name"
2. Connecting to the SQL Server database
Set Conn=server.createobject ("ADODB. Connection ")
conn.connectionstring= "dsn= registered name; Uid=sa; Pwd=sa; "
Conn.Open

Third, OLE DB connection database
1. Connect to an Access database
Set Conn=server.createobject ("ADODB. Connection ")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" &server. MapPath ("dbname (path full name)") & "; Persist Security Info=false "
Set Rs=server.createobject ("ADODB. Recordset ")
2. Connecting to the SQL Server database
Set Conn=server. CreateObject ("ADODB. Connection ")
Sql= "Provider=sqloledb;data source= (local); initial catalog=dbname; User Id=sa;password=sa; "
Conn.Open (SQL)

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.