Click here to Skip to main content
15,881,882 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.
#if !defined(AFX_DBCONNECTIONDLG_H__70600E14_C51D_46BA_A8AE_582FE16DA465__INCLUDED_)
#define AFX_DBCONNECTIONDLG_H__70600E14_C51D_46BA_A8AE_582FE16DA465__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DBConnectionDlg.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CDBConnectionDlg dialog

class CDBConnectionDlg : public CPropertyPage
{
	DECLARE_DYNCREATE(CDBConnectionDlg)

// Construction
public:
	CDBConnectionDlg();
	~CDBConnectionDlg();

	CComboBox			m_cmbServers;
	CComboBox			m_cmbDatabases;

	BOOL ConnectToDatabase(CString strServerName, CString strUserId, CString strPassword,CString strDatabase);

	void RetrieveServerList();
	void RetrieveDatabaseList(CString strServerName, CString strUserId, CString strPassword);
	void RetrieveTableList(CString strServerName, CString strUserId, CString strPassword);

// Dialog Data
	//{{AFX_DATA(CDBConnectionDlg)
	enum { IDD = IDD_DLG_DB_CONNECTION };
	CButton	m_btnRefreshServerList;
	//}}AFX_DATA


// Overrides
	// ClassWizard generate virtual function overrides
	//{{AFX_VIRTUAL(CDBConnectionDlg)
	public:
	virtual BOOL OnSetActive();
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	// Generated message map functions
	//{{AFX_MSG(CDBConnectionDlg)
	afx_msg void OnDropdownCmbServers();
	afx_msg void OnSelchangeCmbServers();
	afx_msg void OnSelchangeComboDatabases();
	afx_msg void OnBtnRefreshServerList();
	afx_msg void OnBtnConnect();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DBCONNECTIONDLG_H__70600E14_C51D_46BA_A8AE_582FE16DA465__INCLUDED_)

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