Click here to Skip to main content
15,896,063 members
Articles / Database Development / SQL Server

Using CLongBinary for BLOBs

Rate me:
Please Sign up or sign in to vote.
4.96/5 (15 votes)
30 Nov 19991 min read 214K   2.5K   52  
// dbImages.cpp : implementation file
//

#include "stdafx.h"
#include "UsingBlob.h"
#include "dbImages.h"

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

/////////////////////////////////////////////////////////////////////////////
// CdbImages

IMPLEMENT_DYNAMIC(CdbImages, CRecordset)

CdbImages::CdbImages(CDatabase* pdb)
	: CRecordset(pdb)
{
	//{{AFX_FIELD_INIT(CdbImages)
	m_BLOBName = _T("");
	m_nFields = 2;
	//}}AFX_FIELD_INIT
	m_nDefaultType = snapshot;
}


CString CdbImages::GetDefaultConnect()
{
	return _T("ODBC;DSN=MS Access Database");
}

CString CdbImages::GetDefaultSQL()
{
	return _T("[Images]");
}

void CdbImages::DoFieldExchange(CFieldExchange* pFX)
{
	//{{AFX_FIELD_MAP(CdbImages)
	pFX->SetFieldType(CFieldExchange::outputColumn);
	RFX_Text(pFX, _T("[BLOBName]"), m_BLOBName);
	RFX_LongBinary(pFX, _T("[BLOBImage]"), m_BLOBImage);
	//}}AFX_FIELD_MAP
}

/////////////////////////////////////////////////////////////////////////////
// CdbImages diagnostics

#ifdef _DEBUG
void CdbImages::AssertValid() const
{
	CRecordset::AssertValid();
}

void CdbImages::Dump(CDumpContext& dc) const
{
	CRecordset::Dump(dc);
}
#endif //_DEBUG

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions