VC inserts a record into the database

xiaoxiao2021-03-06  71

Qinghua Chong Tian Ma Jingfa QQ: 283989349 ?? e-mail: MJF150080@tom.com

When there is a problem, can we pass http://www.hustc.mpc.cn? This forum,

Or through QQ to learn and discuss

// appriseInfo.cpp: importation file //

#include "stdafx.h" #include "train.h" #include "appriseInfo.h" #include "apprisset.h"

#ifdef _debug # define new debug_new # undef this_filestatic char this_file [] = __file __; # ENDIF

/// CAPPRISEINFO DIALOG

CappriseInfo :: CAPPriseInfo (CWND * PParent / * = NULL * /) ?: CDIALOG (CAPPRISEINFO :: IDD, PPARENT) {? {{{AFX_DATA_INIT (CAPPRISEINFO)? M_content = _t ("") ;? m_date = 0; ? //} AFX_DATA_INIT}

? Void CAppriseInfo :: DoDataExchange (CDataExchange * pDX) {CDialog :: DoDataExchange (pDX);?? // {{AFX_DATA_MAP (CAppriseInfo) DDX_Text (pDX, IDC_EDIT3, m_content) ;? DDX_DateTimeCtrl (pDX, IDC_DATETIMEPICKER1, m_date) ;? //}} AFX_DATA_MAP}

Begin_MESSAGE_MAP (CAPPRISEINFO, CDIALOG)? // {AFX_MSG_MAP (CAPPRISEINFO)? ON_BN_CLICKED (IDC_BUTTONRESET, ONBUTTONRESET)? //}} AFX_MSG_MAPEND_MESSAGE_MAP ()

/// CappriseInfo Message Handlers

Void cappriseInfo :: onok () {? / {: add extra validation here? Updatedata (true) ;? cstring strsql; //? CRESOURESET M_RECORDSET (& M_DATABASE);? // m_database database variable in the header file of the implementation file Has been defined? Here is convenient

• CAPPRISESET M_RECORDSET (& M_Database); / / This sentence makes the M_Database database variable to m_recordset

? // Record the database table called by the set, I understand this? Strsql.format ("INSERT INTO Course_evaluation VALUES (% D, / '% D-% D-% d /', / '% s / ') ", COU

RSE_ID, m_date.getyear (), m_date.getMonth (), m_date.getday (), m_content) ;? m_database.executesql (strsql) ;? m_database.close () ;? cdialog :: onok ();}

Void cappriseInfo :: oncancel () {? // Todo: add extra cleanup here ();} cdialog :: oncancel ();

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

New Post(0)