MultiDaoRecordSet::Requery()
{
CMYApp *pApp = ((CMYApp *)AfxGetApp());
if (pApp->pGUIThread == AfxGetThread())
{
CDaoRecordset::Requery();
}
else
{
AfxGetMainWnd()->SendMessage(WM_MULTIDAOMESSAGE, MultiDaoRequery,
(LPARAM)this);
}
}
and, Multidaorecordset.h
#if !defined(AFX_MULTIDAORECORDSET_H__BECC8DC3_A967_11D2_BA4C_006097808646__INCLUDED_)
#define AFX_MULTIDAORECORDSET_H__BECC8DC3_A967_11D2_BA4C_006097808646__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// MultiDaoRecordSet.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CMultiDaoRecordSet DAO recordset
enum {
MultiDaoOpen,
MultiDaoClose,
MultiDaoIsOpen,
MultiDaoIsBOF,
MultiDaoIsEOF,
MultiDaoIsDeleted,
MultiDaoIsFieldDirty,
MultiDaoIsFieldNull,
MultiDaoIsFieldNullable,
MultiDaoGetName,
MultiDaoGetType,
MultiDaoGetSQL,
MultiDaoGetEditMode,
MultiDaoGetLastModifiedBookmark,
MultiDaoGetRecordCount,
MultiDaoMoveNext,
MultiDaoMovePrev,
MultiDaoMoveFirst,
MultiDaoMoveLast,
MultiDaoMove,
MultiDaoFindNext,
MultiDaoFindPrev,
MultiDaoFindFirst,
MultiDaoFindLast,
MultiDaoFind,
MultiDaoGetBookmark,
MultiDaoSetBookmark,
MultiDaoAddNew,
MultiDaoEdit,
MultiDaoUpdate,
MultiDaoDelete,
MultiDaoCancelUpdate,
MultiDaoRequery,
};
#ifdef MULTIDAORECORDSET_CPP
CString cDAOMessageArray =
{
"MultiDaoOpen",
"MultiDaoClose",
"MultiDaoIsOpen",
"MultiDaoIsBOF",
"MultiDaoIsEOF",
"MultiDaoIsDeleted",
"MultiDaoIsFieldDirty",
"MultiDaoIsFieldNull",
"MultiDaoIsFieldNullable",
"MultiDaoGetName",
"MultiDaoGetType",
"MultiDaoGetSQL",
"MultiDaoGetEditMode",
"MultiDaoGetLastModifiedBookmark",
"MultiDaoGetRecordCount",
"MultiDaoMoveNext",
"MultiDaoMovePrev",
"MultiDaoMoveFirst",
"MultiDaoMoveLast",
"MultiDaoMove",
"MultiDaoFindNext",
"MultiDaoFindPrev",
"MultiDaoFindFirst",
"MultiDaoFindLast",
"MultiDaoFind",
"MultiDaoGetBookmark",
"MultiDaoSetBookmark",
"MultiDaoAddNew",
"MultiDaoEdit",
"MultiDaoUpdate",
"MultiDaoDelete",
"MultiDaoCancelUpdate",
"MultiDaoRequery",
};
#else
extern CString cDAOMessageArray;
#endif
class CMultiDaoRecordSet : public CDaoRecordset
{
public:
//jtm
//FORCE user to pass database
CMultiDaoRecordSet(CDaoDatabase* pDatabase);
~CMultiDaoRecordSet();
DECLARE_DYNAMIC(CMultiDaoRecordSet)
// Field/Param Data
//{{AFX_FIELD(CMultiDaoRecordSet, CDaoRecordset)
//}}AFX_FIELD
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMultiDaoRecordSet)
public:
virtual CString GetDefaultDBName(); // Default database name
//}}AFX_VIRTUAL
// Implementation
//jtm
//redefined public functions
//Note: I am only redefining SOME
//of the public functions this is NOT
//a FULL implementation !!!!