03MFC ODBC profile

xiaoxiao2021-03-06  58

Introduction to the ODBC class of MFC

The ODBC class of the MFC has encapsulated more complex ODBC APIs, providing a simplified call interface, which greatly facilitates the development of database applications. Programmers do not have to know the specific details of ODBC API and SQL, using the ODBC class to complete most of the operations of the database.

The ODBC classes of the MFC include:

CDATABASE class: The main function is to establish a connection with the data source. CRecordset class: This class represents a set of records (record sets) selected from the data source, and the program can select a table in the data source as a recordset, or by the query of the table, you can also merge the same data. Multiple tables in the source are listed in a recordset. You can scroll, modify, increase, and delete the records in the records in this class. CRecordView Class: Provides a form view directly connected to a recordset, using a dialog data exchange mechanism (DDX) to transfer data between the record set and the control of the form view. This class supports the recorded browsing and update of records, and automatically shuts down the recordset associated with it automatically when revoking. CFIELDEXCHANGE Class: Support for Record Field Data Exchange (DFX), that is, data exchange between record set field data members and tables of the corresponding database. This class is similar to the dialog data exchange function of the CDataExchange class. CDBEXCEPTION Class: Acting an exception generated by the ODBC class.

In summary, CDATABASE is responsible for connecting data sources; CRecordset is responsible for records for records for records in the data source; CFieldXchange is responsible for the data exchange of CRecordset and data sources.

With AppWizard and ClassWizard, users can easily establish database applications, but this does not mean nothing to know about the ODBC classes of the MFC. Readers should pay attention to reading the contents in the subsequent sections and lay the foundation for the following examples.

转载请注明原文地址:https://www.9cbs.com/read-84770.html

New Post(0)