ATL com and ADO

Source: Internet
Author: User
Tags object model ole

I recently made an online banking project in Niit.bangalore. This project is written almost in VB, and only a small part of it involves the ATL component, which only teaches us to write distributed applications. I wrote a middle-tier component that used ATL and ADO to query back-end (SQL Server) and some of the code was shown here.

I assume that the reader understands (at least) ATL's COM programming and VB's ADO programming

What is ADO?

ADO is an abbreviation for an ActiveX Data Object (ActiveX). ADO uses OLE DB data support to provide an object-oriented interface to access data sources, a synthesizer of the DAO and RDO object model, which brings together the advantages of DAO and RDO.

C + + writing an OLE DB program is easy. However, it is difficult to implement OLE DB for languages that do not provide pointers and other C + + features, such as visual Basic.

That's why ADO really faces. ADO is an advanced interface for OLE DB based on COM interface technology, so any application that supports COM can implement ADO.

Features of ADO

Allow access to all data types

Provide free threading

Provide asynchronous queries

Provides client and server-side pointers

To provide a separate set of records

The architecture of ADO

In the ADO model, we will use three main types of objects:

Connection

Command

Recordset

The Connection object is used to establish a connection to the data source, where, first, the data source name, location, user ID, password, etc. are stored in the ConnectionString object to be passed to the Connection object to connect to the data source.

Command objects are used to execute SQL commands, queries, and stored procedures

When a query is executed, it returns a set of result sets that are stored by the Recordset object, and the data in the recordset can be modified and updated to the database.

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.