home *** CD-ROM | disk | FTP | other *** search
- // QueryDefSet.cpp : implementation of the CQueryDefSet class
- //
-
- #include "stdafx.h"
- #include "QueryDef.h"
- #include "QDefSet.h"
-
- #include <io.h>
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CQueryDefSet implementation
-
- IMPLEMENT_DYNAMIC(CQueryDefSet, CDaoRecordset)
-
- CQueryDefSet::CQueryDefSet(CDaoDatabase* pdb)
- : CDaoRecordset(pdb)
- {
- //{{AFX_FIELD_INIT(CQueryDefSet)
- m_Title = _T("");
- m_Year_Published = 0;
- m_ISBN = _T("");
- m_PubID = 0;
- m_Description = _T("");
- m_Notes = _T("");
- m_Subject = _T("");
- m_Comments = _T("");
- m_nFields = 8;
- //}}AFX_FIELD_INIT
- m_nDefaultType = dbOpenDynaset;
- }
-
- CString CQueryDefSet::GetDefaultDBName()
- {
- struct _finddata_t c_file;
- long hFile;
- CString fname = "..\\..\\biblio.mdb";
-
- hFile = _findfirst(fname, &c_file);
- if (-1 != hFile)
- return _T(fname);
-
- fname = "..\\biblio.mdb";
- hFile = _findfirst(fname, &c_file);
- if (-1 != hFile)
- return _T(fname);
-
- return _T("");
- }
-
-
- CString CQueryDefSet::GetDefaultSQL()
- {
- return _T("[Titles]");
- }
-
- void CQueryDefSet::DoFieldExchange(CDaoFieldExchange* pFX)
- {
- //{{AFX_FIELD_MAP(CQueryDefSet)
- pFX->SetFieldType(CDaoFieldExchange::outputColumn);
- DFX_Text(pFX, _T("[Title]"), m_Title);
- DFX_Short(pFX, _T("[Year Published]"), m_Year_Published);
- DFX_Text(pFX, _T("[ISBN]"), m_ISBN);
- DFX_Long(pFX, _T("[PubID]"), m_PubID);
- DFX_Text(pFX, _T("[Description]"), m_Description);
- DFX_Text(pFX, _T("[Notes]"), m_Notes);
- DFX_Text(pFX, _T("[Subject]"), m_Subject);
- DFX_Text(pFX, _T("[Comments]"), m_Comments);
- //}}AFX_FIELD_MAP
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CQueryDefSet diagnostics
-
- #ifdef _DEBUG
- void CQueryDefSet::AssertValid() const
- {
- CDaoRecordset::AssertValid();
- }
-
- void CQueryDefSet::Dump(CDumpContext& dc) const
- {
- CDaoRecordset::Dump(dc);
- }
- #endif //_DEBUG
-