A Unique Developer

Forward Engineering using Visio 2007 Database model to sql server

This is first ever I was trying for Visio Database model to design database without knowing that forward engineering doesn't support on Visio 2007. I googled it lot about this but doesn't find such direct option for forward engineering of Database model. After bit on searching I found that "Orthogonal Software Corporation" provide toolbox which let you export as xml of your database diagram and using xslt file (provided by Orthogonal Software Corportation) you can generate sql script.

I started working with it and real pain start from here. I am using Window 7 and Visio 2007 and when I downloaded above mention tool and tried to install it and got error ".Net Framework 1.1.xxxx required and in window 7 you will have only 2.xx,3.x and 4.x.Here again start googleing on this and found really useful article by Saran who mention all steps to install .Net 1.1. (I just copy and paste from Saran blog but all credits for below 8 steps goes to Saran only)

1. Create a new folder named DotNet in C:\ drive. (The path i used was C:\DotNet )
2. Download Microsoft .NET Framework 1.1 Redistributable Package (dotnetfx.exe). Make
sure the setup file is saved as dotnetfx.exe.
3. Download Microsoft .NET Framework 1.1 Service Pack 1 (NDP1.1sp1-KB867460-
X86.exe). Rename the file to dotnetfxsp1.exe.
4. Copy both installation files into the same directory (i.e. C:\DotNet),.
5. Open Command Prompt as Administrator.
6. Change to the directory where the two installation files are stored, ie
7. Run the following commands one by one.

--> dotnetfx.exe /c:"msiexec.exe /a netfx.msi TARGETDIR=C:\DotNet"

Click on Yes and wait for this dialog which says installation complete.

--> dotnetfxsp1.exe /Xp:C:\DotNet\netfxsp.msp

--> msiexec.exe /a c:\DotNet\netfx.msi /p c:\DotNet\netfxsp.msp

Wait for the installer to disappear automatically.

8. Install Microsoft .Net Framework 1.1 with slipstreamed Service Pack 1 by running netfx.msi from the working folder.


Ok, Here I finish with installing .Net Framework 1.1 and later able to install toolbox downloaded successfully.

Open my Visio 2007 and open database diagram I had created before and I see "Orthogonal toolbar" just click on it and tried to export as xml and one more error again "Do not have permission to write in registry" (or similar to it). But do not panic just open visio with administrative access and this error will go and able to generate xml correctly.

Now it time to genereate script from xml. Download xslt file from here (Credit goes to Along) put xslt file in same folder where your xml is. Open your exported xml file and add <?xml-stylesheet type="text/xsl" href="ERD-SQL2005.xslt"?> after the first line of xml defination and open xml file in browser.

So everything fine now.

  1. .Net framework 1.1 installed.
  2. "Orthogonal toolbar" installed on visio 2007.
  3. Able to generate sql script.

and go back to my another work, Open my localhost and here I face one more issue. My previously running site thowing below error.

"Calling LoadLibraryEx on ISAPI filter “C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_filter.dll” failed".

I guess this is because of .Net framework 1.1 I had installed so just register framework 4.x again and able to back up my localhost.

To re-register your framework to IIS.

Open command prompt with administrative rights, navigate to C:\Windows\Microsoft .NET\FrameWork64\ directory and run aspnet_regiis -r.

Finally I got everything working good.

Hope this help.