0% found this document useful (0 votes)
38 views3 pages

Database ODBC Without File Support

Project Name : ODBCWithoutFileSupport In View.cpp // ODBCWithoutFileSupportView.cpp : implementation of the CODBCWithoutFileSupportView class #include "stdafx.h" #include "ODBCWithoutFileSupport.h" #include "ODBCWithoutFileSupportSet.h" #include "ODBCWithoutFileSupportDoc.h" #include "ODBCWithoutFileSupportView.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif // CODBCWithoutFileSupportView IMPLEMENT_DYNCREATE(CODBCWithoutFileSupportView, CRecordV

Uploaded by

michael.ferraris
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
0% found this document useful (0 votes)
38 views3 pages

Database ODBC Without File Support

Project Name : ODBCWithoutFileSupport In View.cpp // ODBCWithoutFileSupportView.cpp : implementation of the CODBCWithoutFileSupportView class #include "stdafx.h" #include "ODBCWithoutFileSupport.h" #include "ODBCWithoutFileSupportSet.h" #include "ODBCWithoutFileSupportDoc.h" #include "ODBCWithoutFileSupportView.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif // CODBCWithoutFileSupportView IMPLEMENT_DYNCREATE(CODBCWithoutFileSupportView, CRecordV

Uploaded by

michael.ferraris
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1/ 3

Project Name : ODBCWithoutFileSupport

In View.cpp
// ODBCWithoutFileSupportView.cpp : implementation of the
CODBCWithoutFileSupportView class

#include "stdafx.h"
#include "ODBCWithoutFileSupport.h"

#include "ODBCWithoutFileSupportSet.h"
#include "ODBCWithoutFileSupportDoc.h"
#include "ODBCWithoutFileSupportView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

// CODBCWithoutFileSupportView

IMPLEMENT_DYNCREATE(CODBCWithoutFileSupportView, CRecordView)

BEGIN_MESSAGE_MAP(CODBCWithoutFileSupportView, CRecordView)
//{{AFX_MSG_MAP(CODBCWithoutFileSupportView)
ON_COMMAND(ID_RECORD_ADD, OnRecordAdd)
ON_COMMAND(ID_RECORD_DELETE, OnRecordDelete)
ON_COMMAND(ID_RECORD_UPDATE, OnRecordUpdate)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CRecordView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CRecordView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW,
CRecordView::OnFilePrintPreview)
END_MESSAGE_MAP()

// CODBCWithoutFileSupportView construction/destruction

CODBCWithoutFileSupportView::CODBCWithoutFileSupportView()
: CRecordView(CODBCWithoutFileSupportView::IDD)
{
//{{AFX_DATA_INIT(CODBCWithoutFileSupportView)
m_pSet = NULL;
//}}AFX_DATA_INIT
// TODO: add construction code here

}
CODBCWithoutFileSupportView::~CODBCWithoutFileSupportView()
{
}
void CODBCWithoutFileSupportView::DoDataExchange(CDataExchange* pDX)
{
CRecordView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CODBCWithoutFileSupportView)
DDX_FieldText(pDX, IDC_EDIT1, m_pSet->m_Sid, m_pSet);
DDX_FieldText(pDX, IDC_EDIT2, m_pSet->m_Sname, m_pSet);
DDX_FieldText(pDX, IDC_EDIT3, m_pSet->m_Syear, m_pSet);
//}}AFX_DATA_MAP
}
BOOL CODBCWithoutFileSupportView::PreCreateWindow(CREATESTRUCT& cs)
{
return CRecordView::PreCreateWindow(cs);
}
void CODBCWithoutFileSupportView::OnInitialUpdate()
{
m_pSet = &GetDocument()->m_oDBCWithoutFileSupportSet;
CRecordView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();
}

// CODBCWithoutFileSupportView printing

BOOL CODBCWithoutFileSupportView::OnPreparePrinting(CPrintInfo* pInfo)


{
return DoPreparePrinting(pInfo);
}
void CODBCWithoutFileSupportView::OnBeginPrinting(CDC* /*pDC*/,
CPrintInfo* /*pInfo*/)
{ }
void CODBCWithoutFileSupportView::OnEndPrinting(CDC* /*pDC*/,
CPrintInfo* /*pInfo*/)
{ }

// CODBCWithoutFileSupportView diagnostics

#ifdef _DEBUG
void CODBCWithoutFileSupportView::AssertValid() const
{
CRecordView::AssertValid();
}
void CODBCWithoutFileSupportView::Dump(CDumpContext& dc) const
{
CRecordView::Dump(dc);
}
CODBCWithoutFileSupportDoc*
CODBCWithoutFileSupportView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument-
>IsKindOf(RUNTIME_CLASS(CODBCWithoutFileSupportDoc)));
return (CODBCWithoutFileSupportDoc*)m_pDocument;
}
#endif //_DEBUG
// CODBCWithoutFileSupportView database support

CRecordset* CODBCWithoutFileSupportView::OnGetRecordset()
{
return m_pSet;
}

// CODBCWithoutFileSupportView message handlers

void CODBCWithoutFileSupportView::OnRecordAdd()
{
m_pSet->AddNew();
UpdateData(true);
m_pSet->Update();
}
void CODBCWithoutFileSupportView::OnRecordDelete()
{
m_pSet->Delete();
}
void CODBCWithoutFileSupportView::OnRecordUpdate()
{
m_pSet->Edit();
UpdateData(true);
m_pSet->Update();
}

OUTPUT

You might also like