5,421,850 members and growing! (22,232 online)
Email Password   helpLost your password?
Desktop Development » Miscellaneous » General     Advanced License: The Code Project Open License (CPOL)

Generating Data Dictionary or Database Design Document using MS Word Macros

By Shashidhar Rao Nellutla

Generating Data Dictionary or Database Design Document using MS Word Macros
VB (VB 6, VB), VBScript, Dev, Design

Posted: 31 Mar 2008
Updated: 31 Mar 2008
Views: 3,915
Bookmarked: 5 times
Announcements
Want a new Job?



Search    
Advanced Search
Sitemap
4 votes for this Article.
Popularity: 1.66 Rating: 2.75 out of 5
2 votes, 50.0%
1
0 votes, 0.0%
2
0 votes, 0.0%
3
1 vote, 25.0%
4
1 vote, 25.0%
5
Note: This is an unedited contribution. If this article is inappropriate, needs attention or copies someone else's work without reference then please Report This Article

Introduction

Manually preparing data dictionary document will take ages in MS Word which contains 100's of tables, stored procedures, functions, triggers, views, indexes, etc. in the SQL Server database as you need to type each and every column of the table along with the associated dependencies. I need a data dictionary document which generates the database schema automatically in one click with nicely formatted. For this I did lot of research in Google to find the solution and finally I have wrote my own code to do this functionality and i thought to share my experience with you all.

The main purpose of this article is to generate the data dictionary document automatically by simply running the macro code in MS Word with in seconds.

I am not a guru of VBA but still started doing some kind of researching on VBA code in Google then I got ideas from different forums and many thanks to those people who posted their ideas.

I hope this solution will help you to prepare the data dictionary document. Here we start...

Basically, this code will prepare you the following information in the document

Table name with the following dependent information.

· Table Column Details
· Indexes
· Views
· Stored Procedures
· Functions
· Triggers
· Primary Keys
· Foreign Keys
· Default Constraints
· Identity Columns

Using the code

Following are the steps to run this code:

1. Simply open a blank word document (it is mandatory).

2. Go to menu Tools->Macro->Macros->Create then this will create a new visual basic module editor.

3. Paste this code.

4. Change the connection string as per your SQL Server credentials (it is mandatory).

5. Add the references of Microsoft Active X Data Objects Library from the menu Tools->References

6. Run the macro by pressing F5 from VBA editor.

Document_Template.JPG

Points of Interest

This code will generate the data dictionary document automatically with one click and it is simple to use this code.

History

Keep a running update of any changes or improvements you've made here.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Shashidhar Rao Nellutla


Completed Masters in Computer Applications.
Occupation: Software Developer (Senior)
Location: United Kingdom United Kingdom

Other popular Miscellaneous articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 4 of 4 (Total in Forum: 4) (Refresh)FirstPrevNext
Subject  Author Date 
GeneralWord 2007memberMember 21710099:09 17 Jun '08  
GeneralMacro not workingmemberniranjan singh4:15 14 Apr '08  
GeneralRe: Macro not workingmembergrom_boy0:36 15 Apr '08  
GeneralRe: Macro not working [modified]memberAndrewGail6:12 24 Apr '08  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 31 Mar 2008
Editor:
Copyright 2008 by Shashidhar Rao Nellutla
Everything else Copyright © CodeProject, 1999-2008
Web18 | Advertise on the Code Project