Click here to Skip to main content
15,884,097 members
Articles / Database Development / SQL Server

Database Visualization

Rate me:
Please Sign up or sign in to vote.
4.60/5 (11 votes)
31 May 20067 min read 81.5K   2.8K   77  
This article aims to create a simple tool for visualizing database tables and relations, a database map to refer to.
// QueryBuilder.cpp : Defines the class behaviors for the application.
#include "stdafx.h"
#include "QueryBuilder.h"
#include "DBConnectionDlg.h"
#include "SelectColumnsDlg.h"
#include "SelectRelationsDlg.h"
#include "GenerateCodeDlg.h"

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

BEGIN_MESSAGE_MAP(CQueryBuilderApp, CWinApp)
	//{{AFX_MSG_MAP(CQueryBuilderApp)
	//}}AFX_MSG
	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()

CQueryBuilderApp::CQueryBuilderApp(){}

CQueryBuilderApp theApp;

// CQueryBuilderApp initialization
BOOL CQueryBuilderApp::InitInstance()
{
	AfxEnableControlContainer();

	#ifdef _AFXDLL
		Enable3dControls();			// Call this when using MFC in a shared DLL
	#else
		Enable3dControlsStatic();	// Call this when linking to MFC statically
	#endif

	::CoInitialize(NULL);

	CPropertySheet QueryBuilderWizard("Visual Query Builder");

	CDBConnectionDlg	dlgDBConnection;
	CSelectColumnsDlg	dlgSelectColumns;
	CSelectRelationsDlg	dlgSelectRelations;
	CGenerateCodeDlg	dlgGenerateCode;

	QueryBuilderWizard.m_psh.dwFlags &= ~PSH_HASHELP;

	dlgDBConnection.m_psp.dwFlags	 &= (~PSP_HASHELP);
	dlgSelectColumns.m_psp.dwFlags	 &= (~PSP_HASHELP);
	dlgSelectRelations.m_psp.dwFlags &= (~PSP_HASHELP);
	dlgGenerateCode.m_psp.dwFlags	 &= (~PSP_HASHELP);

	QueryBuilderWizard.AddPage(&dlgDBConnection);
	QueryBuilderWizard.AddPage(&dlgSelectColumns);
	QueryBuilderWizard.AddPage(&dlgSelectRelations);
	QueryBuilderWizard.AddPage(&dlgGenerateCode);

	QueryBuilderWizard.SetWizardMode();

	QueryBuilderWizard.DoModal();

	::CoUninitialize();

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}

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
Founder
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions