Introduction to ODBC in 03mfc

Source: Internet
Author: User
Introduction to ODBC in MFC

MFC

The ODBC class encapsulates complex ODBC APIs and provides simplified calling interfaces, which greatly facilitates the development of database applications. Programmers can perform most database operations without having to know the detailed odbc api and SQL.

MFC

ODBC categories include:

Cdatabase

Class: The main function is to establish a connection with the data source.

Crecordset

Class: This class indicates a set of records (record set) selected from the data source. The program can select a table in the data source as a record set, or obtain a record set by querying the table, you can also merge columns from multiple tables in the same data source to one record set. this type allows you to scroll, modify, add, and delete records in a record set.

Crecordview

Class: A form view is directly connected to a record set, and data is transmitted between the control of the record set and form view using the dialog box data exchange mechanism (DDX. This class supports browsing and updating records, and the associated record set is automatically closed when you cancel the operation.

Cfieldexchange

Class: supports field data exchange (DFX), that is, the data exchange between the members of the record set field data and the fields of the corresponding database table. This type of function is similar to the dialog box data exchange function of the cdataexchange class.

Cdbexception

Class: indicates the exceptions of the ODBC class.

To sum up,

Cdatabase is used for a database to connect to the data source. crecordset is used for record set operations in the data source. crecordview is used for the interface, and cfieldexchange is used for data exchange between crecordset and the data source.

Exploitation

Appwizard and classwizard. You can easily create database applications, but this does not mean that you can know nothing about the ODBC class of MFC. readers should read the content in the following sections to lay a solid foundation for the examples.

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.