Detailed description of Visual C ++ programming Database

Source: Internet
Author: User
Tags dbase driver manager

Currently, Visual C ++ is not widely available in Web development. In enterprise applications ,. NETC # is one of the most important members. C ++ still has a place to share with you. I hope this article will teach you more.

An odbc-based application does not rely on any dbms for database operations and does not directly deal with dbms. All database operations are completed by the corresponding dbms odbc driver. That is to say, both foxpro, access, and oracle databases can be accessed using odbc APIs. It can be seen that the biggest advantage of odbc is that it can process all databases in a unified manner.

A complete Visual C ++ language consists of the following components:

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 a dll that provides interfaces between odbc and databases. Data source. The data source contains information such as the database location and database type, which is actually an abstraction of data connections. The relationship between components is shown in the following figure:

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.

In odbc, odbc APIs cannot directly access the database and must exchange information with the database through the driver manager. 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.

  • Describes how to get started with Visual C ++
  • Describes how to learn the C ++ Language
  • Introduction to the C ++ Language Structure
  • Several minutes to help you solve the C ++ complexity Problem
  • C ++ programmers explain C ++ programming skills


The odbc driver is required to access the odbc data source. You can use Visual C ++ 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.

1 ado is an integral part of Microsoft's entire com strategic system

Activity data object (ado) is a group of com components provided by Microsoft. Ado is built on the com architecture advocated by Microsoft. All its interfaces are automated interfaces, therefore, you can access ado through interfaces in c ++, Visual Basic, delphi, and other development languages that support com. By using the new ole db technology, ado allows you to access data from relational databases, text files, non-relational databases, indexing servers, and Active Directory Services in the same way, it expands the range of data sources available in applications and becomes the preferred choice for accessing data source components in Microsoft's entire com strategic system. It is an alternative to odbc.

2 Visual C ++ language model Composition

Compared with other data access models of Microsoft, dao and rdo, ado object models are very refined. They only consist of three main objects: connection, command, recordset, and several secondary objects. The connection object provides the association between the ole db data source and the conversation object. It uses the user name and password to process user identity authentication and provides transaction processing support. It also provides execution methods, this simplifies the process of data source connection and data retrieval. The command object encapsulates commands that can be interpreted by the data source. This command can be anything that can be understood by SQL commands, stored procedures, or underlying data sources.

  • Describes how to get started with Visual C ++
  • Describes how to learn the C ++ Language
  • Introduction to the C ++ Language Structure
  • Several minutes to help you solve the C ++ complexity Problem
  • C ++ programmers explain C ++ programming skills

Record set is used to indicate the table data returned from the data source. It encapsulates methods such as navigation, record Update, record deletion, and adding new records of the record set, and also provides the ability to update records in batches. Other secondary objects provide columns that encapsulate ado errors, encapsulation command parameters, and encapsulation record sets.

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.