Click here to Skip to main content
Click here to Skip to main content
Articles » Database » Database » General » Downloads
 
Add your own
alternative version
Go to top

Accessing the Borland Database Engine (BDE) from Visual C++

, 17 Nov 1999
bdedatabase_demo.zip
MfcResearch
BdeTest
vc4bde32.zip
IDAPI32M.LIB
IDAPI32.LIB
Release
BdeTest.exe
TEST.TV
Test.DBF
Test.DBT
TEST.FAM
Test.MB
Test.PX
Test.DB
BdeTest.dsw
BdeTest.dsp
res
BdeTest.ico
bdedatabase_src.zip
//////////////////////////////////////////////////////////////////////////
//  BdeException.h -- Interface for Borland Database Engine exception handler


#ifndef __BDEEXCEPION_H__
#define __BDEEXCEPION_H__

//#include "Ms-idapi.h" // header file for BDE API calls

// Actually, we are supposed to include Ms-idapi.h, but all it has is
// the following three lines anyway.  This allows me to keep idapi.h in the project directory  
#define	__FLAT__
#define __WIN32__
#include "idapi.h"


// These are additional errors that may be generated in the 
// CBdeDatabase class
#define BDEEXERR_FIELDNOTINTEGER 1
#define BDEEXERR_FIELDNOTFLOAT 2
#define BDEEXERR_FIELDNOTDATE 3
#define BDEEXERR_FIELDNOTSTRING 4
#define BDEEXERR_NOSUCHFIELD 5
#define BDEEXERR_NOTINEDITMODE 6
#define BDEEXERR_ALREADYINEDITMODE 7
#define BDEEXERR_INVALIDCURSOR 8
#define BDEEXERR_ALREADYOPEN 9
#define BDEEXERR_NOTINITIALIZED 10
#define BDEEXERR_INVALIDDATETIMEFORMAT 11
#define BDEEXERR_UNSUPPORTEDFIELDTYPE 12
#define BDEEXERR_UNSUPPORTEDBLOBTYPE 13
#define BDEEXERR_FIELDNOTBOOLEAN 14
#define BDEEXERR_INVALIDFIELDINDEX 15
#define BDEEXERR_INVALIDFIELDNAME 16


class CBdeException : public CException
{
	DECLARE_DYNAMIC(CBdeException);

// construction/destruction
public:
	CBdeException();
	CBdeException(DBIResult dbiResult);
	CBdeException(DBIResult dbiResult, CString strTable,
		CString strDatabaseName, LPCTSTR szAddInfo);
	CBdeException(DBIResult dbiResult, UINT nExtendedError, CString strTable,
		CString strDatabaseName, LPCTSTR szAddInfo);
	
// Attributes
public:


protected:
	DBIResult m_dbiResult;
	UINT m_nExtendedError;
	CString m_strAddInfo;
	CString m_strTableName;
	CString m_strDatabaseName;

// Operations
public:
	virtual BOOL GetErrorMessage(LPTSTR lpszError, UINT nMaxError, 
		PUINT pnHelpContext = NULL);
	CString GetErrorMessage(BOOL bVerbose = TRUE);
	virtual int ReportError(UINT nType = MB_OK, UINT nMessageID = 0);
	static CString GetExtendedErrorMessage(int nError);


protected:

// inlines
public:
	inline LPCTSTR GetTableName() {
		return m_strTableName; }
	inline LPCTSTR GetAddInfo() {
		return m_strAddInfo; }
	inline LPCTSTR GetDatabaseName() {
		return m_strDatabaseName; }
	



}; // end of class definition



#endif __BDEEXCEPION_H__

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

Share

About the Author

Robert Pittenger, MCPD-EAD
President Starpoint Software Inc.
United States United States
Bob Pittenger is founder and President of Starpoint Software Inc. He holds a B.A. degree from Miami University, M.S. and Ph.D. degrees from Purdue University, and an MBA from Xavier University. He has been programming since 1993, starting with Windows application development in C++/MFC and moving to C# and .NET around 2005 and is a .NET Microsoft Certified Professional Developer.
 
Bob is the author of two books:
Billionaire: How the Ultra-Rich Built Their Fortunes Through Good and Evil and What You Can Learn from Them
and
Wealthonomics: The Most Important Economic and Financial Concepts that Can Make You Rich Fast.
Visit http://www.billionairebook.net for more information.

| Advertise | Privacy | Mobile
Web02 | 2.8.140921.1 | Last Updated 18 Nov 1999
Article Copyright 1999 by Robert Pittenger, MCPD-EAD
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid