Use the MFC CRecord class separately (original experience)

xiaoxiao2021-03-05  22

In the development of the VC 6.0 and ODBC in development, the database is used to improve the flexibility, so the CRecordset class is used to establish an object. Connecting the database in use, there is no problem with the recordset, and the original functions such as MoveFirst / MoveNext / MovePrev / MoveLast in CRecordset can be used normally, but when I want to use the delete () function of the CRecordset class. It will be reported to Assert Failed. After the TRACER discovery problem, the judgment if (m_nfields <0) ASSERT (FALSE) in the setfieldnull () function; trace discovery, the MFC ClassWizard is automatically assigned to assign M_nfields in the constructor. However, when we freely use CRecordset, there is no this, and when I display the M_NFields assignment, I will still report an error, which is about RFX errors. There is no UPDATE operation with the CRecordset class, but the article written by other friends should be SELECT. There is no problem. It seems that I have to make up the RFX part, the latter is not completed due to the time relationship. Complete the test updated this document.

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

New Post(0)