HOW TO: Link Shape Data in a Visio Drawing to a SQL Server Database (319984)
The information in this article applies to:
- Microsoft Visio 2002 Professional
- Microsoft Visio 2002 Standard
- Microsoft Visio Network Central
- Microsoft Visio Network Equipment
This article was previously published under Q319984 SUMMARY
This step-by-step article describes how to link shape data in a Microsoft Visio drawing to a Microsoft SQL Server 2000 database.
If you establish connections between shapes and database records, you can create Visio drawings that function as visual representations of data. After you establish a shape-record connection, you can create new shapes from database records, synchronize the data in your Visio drawing with the database, and, if you have write-access rights to the database, update the database from your Visio drawing.
Every Visio shape is described in its own ShapeSheet spreadsheet, which contains information about the shape's geometry and its other properties. If you link a shape to a database, you actually link cells in the shape's ShapeSheet spreadsheet to fields in a database table. Typically, you link a shape's custom properties to database fields.
back to the top
How to Link Shape Data in a Visio Drawing to a Microsoft SQL Server 2000 Database
To link shape data in a Visio drawing to a SQL Server 2000 database, follow these steps in the order in which they are presented.
Export Visio Data to the Database
To export data that is stored in shapes on a Visio drawing to a database, follow these steps:
- Start Visio and then open the drawing that contains the shape data that you want to export.
- On the Tools menu, point to Macros, point to Visio Extras, and then click Database Export Wizard.
The Database Export Wizard starts.
- Click Next.
- Verify that the drawing that you want to export appears in the Choose a drawing or click Browse to open a drawing box, and then click Next.
- Specify the shapes in the drawing from which you want to export data, and then click Next.
- Specify the ShapeSheet cells and fields that you want to export to the database table, and then click Next.
- Do one of the following, as appropriate to your situation:
- If the Open Database Connectivity (ODBC) data source exists, click the data source in the Select an ODBC data source to export to list, and then click Next. Go to step 8.
-or-
- If the ODBC data source does not exist, create it. To do so:
- Click Create data source.
The Create New Data Source Wizard opens.
- Specify the type of data source that you want to create, and then click Next.
- In the Select a driver for which you want to set up a data source list, click SQL Server, and then click Next.
- Verify that the options that you selected are correct, and then click Finish.
The Create a New Data Source to SQL Server Wizard opens. - Type a name and description for the data source in the Name and Description boxes. In the Server box, specify the SQL server to which you want to connect, and then click Next.
- Specify the options with which you want to verify the authenticity of the login ID, and then click Next.
- Specify the database options that you want, and then click Next.
- Specify the language settings and log options that you want, and then click Finish.
- Verify that the options that you selected are correct, and then click OK.
- Specify the name of the database table to which you want to export the shape data. Specify the type of data that you want in the key field, and then click Next.
- Specify how you want the shape data to be interpreted in the database table, and then click Next.
- If you want the option to re-export data to the database when you right-click a shape on the drawing page, click to select the Add export right mouse action to the drawing page check box. Click Next.
- Verify that the options that you selected are correct, and then click Finish.
back to the top
Link the Visio Drawing to the Database- On the Tools menu, point to Macros, point to Visio Extras, and then click Link to Database.
- In the Name box, click the name of the ODBC data source to which you want to connect, and then click OK.
- Right-click a shape on your drawing page.
- From the following options that appear on the shortcut menu, click the option that represents the action that you want to perform.
- Select Database Record
- Refresh Shapes Properties
- Update Database Record
- Delete Shape and Record
back to the top
REFERENCESFor more information about how to link Visio shapes and drawings to a database, type linking shapes to databases in the Ask a question box or the Answer Wizard, and then press ENTER to view the topics. For additional information about how to use Visio, click the article number below
to view the article in the Microsoft Knowledge Base:
281273 Visio: Online Resources for Books, Training, Tips, Updates, Development, Solution Providers, and Support
back to the top
Modification Type: | Minor | Last Reviewed: | 1/9/2006 |
---|
Keywords: | kbhowto kbHOWTOmaster KB319984 |
---|
|