Click here to Skip to main content
15,897,968 members
Articles / Desktop Programming / MFC

MsAccess MdbTools with MFC and .NET

Rate me:
Please Sign up or sign in to vote.
4.82/5 (9 votes)
13 Jan 2012LGPL310 min read 69.3K   9.9K   49  
Viewer of MsAccess databases directly from MFC and .NET - Repair corrupt databases
#pragma once

enum MdbLibColType
{
	MdbLib_BOOL = 0x01,
	MdbLib_BYTE = 0x02,
	MdbLib_INT = 0x03,
	MdbLib_LONGINT = 0x04,
	MdbLib_MONEY = 0x05,
	MdbLib_FLOAT = 0x06,
	MdbLib_DOUBLE = 0x07,
	MdbLib_DATETIME = 0x08,
	MdbLib_BINARY = 0x09,
	MdbLib_TEXT = 0x0a,
	MdbLib_OLE = 0x0b,
	MdbLib_MEMO = 0x0c,
	MdbLib_REPID = 0x0f,
	MdbLib_NUMERIC = 0x10
};

//class EXPIMPMDBLIB CMdbLibColumn
class CMdbLibColumn
{
public:

	char* Name;
	MdbLibColType Type;
	int Size;

	int IsInt()
	{
		switch (Type)
		{
			case MdbLib_BOOL: case MdbLib_BYTE: case MdbLib_INT: case MdbLib_LONGINT:
			case MdbLib_REPID:
				return 1;
			default:
				return 0;
		}
	}

	int IsNumDec()
	{
		switch (Type)
		{
			case MdbLib_MONEY: case MdbLib_FLOAT: case MdbLib_DOUBLE: case MdbLib_NUMERIC:
				return 1;
			default:
				return 0;
		}
	}
	int IsBinary()
	{
		switch (Type)
		{
			case MdbLib_BINARY: case MdbLib_MEMO: case MdbLib_OLE:
				return 1;
			default:
				return 0;
		}
	}
	int IsDate()
	{
		return (Type == MdbLib_DATETIME);
	}

};

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, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
Software Developer
Argentina Argentina
System developer from Argentina.

Programmed in VB 5,6,.NET, C#, Java, PL-SQL, Transac-SQL, C, C++ and even some "calculator" language.

Love to build small, useful applications.
Usually building big and complicated apps based on solid, reliable components.

Hobbies: reading, photography, chess, paddle, running.

Comments and Discussions