How Visio can reverse-connect a database to generate an ER diagram (that is, automatically generate ER diagrams from a database)
In the use of the author, there is an automatic generation of ER graph requirements. After a while, there are ready-made tools to do it. Now share with you:
This article takes IBM DB2 as an example to generate ER diagrams. All other databases are the same, Oracle, SQL Server, Sybase, etc.
How does Visio reverse-connect DB2 generate ER diagrams?
I. Building an ODBC data source
Open the Control Panel-> Administrative Tools-> Data Source (ODBC) to open the ODBC data Source manager. Select the System DSN and add a system data source. Select the IBM DB2 ODBC Druver as the driver for the data source-> dot "Finish" button, enter the data source name "Test", the database Alias "Test" (the DB2 database to connect to), describe "Testdes", click "OK" button, Back to the ODBC Data Source Administrator interface. Select the data source "TEST", point Configuration button, enter the user ID and password (connect "TEST" (database username and password), and click "OK" for the "Connect to data source to retrieve configuration information" option on the data source options. Complete the configuration of the data source ;
Two. Create a new database Model diagram in Visio
Open Visio, file-> new-> database-> Database Model diagram. After you have established the Database Model diagram, the menu bar has one more item "database". Point Database menu-> reverse engineering. In the Reverse Engineer Wizard:
Installed Visio drivers select ODBC Generic driver, "data source" Choose TEST ", click" Next "button, enter username and password of connection database, click" OK "button," Object Type "Select Table, primary key, index, foreign key, point" next "button, Select the table to generate the ER diagram, click Next, select Yes, add shape to current page, click Next button, and click Finish.