Microsoft KB Archive/319984

From BetaArchive Wiki

Article ID: 319984

Article Last Modified on 1/9/2006



APPLIES TO

  • Microsoft Visio 2002 Professional Edition
  • Microsoft Visio 2002 Standard Edition
  • Microsoft Visio Network Center
  • Microsoft Visio Network Center



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:

  1. Start Visio and then open the drawing that contains the shape data that you want to export.
  2. On the Tools menu, point to Macros, point to Visio Extras, and then click Database Export Wizard.

    The Database Export Wizard starts.
  3. Click Next.
  4. 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.
  5. Specify the shapes in the drawing from which you want to export data, and then click Next.
  6. Specify the ShapeSheet cells and fields that you want to export to the database table, and then click Next.
  7. 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:
      1. Click Create data source.

        The Create New Data Source Wizard opens.
      2. Specify the type of data source that you want to create, and then click Next.
      3. In the Select a driver for which you want to set up a data source list, click SQL Server, and then click Next.
      4. Verify that the options that you selected are correct, and then click Finish.

        The Create a New Data Source to SQL Server Wizard opens.
      5. 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.
      6. Specify the options with which you want to verify the authenticity of the login ID, and then click Next.
      7. Specify the database options that you want, and then click Next.
      8. Specify the language settings and log options that you want, and then click Finish.
      9. Verify that the options that you selected are correct, and then click OK.
  8. 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.
  9. Specify how you want the shape data to be interpreted in the database table, and then click Next.
  10. 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.
  11. Verify that the options that you selected are correct, and then click Finish.

back to the top

Link the Visio Drawing to the Database

  1. On the Tools menu, point to Macros, point to Visio Extras, and then click Link to Database.
  2. In the Name box, click the name of the ODBC data source to which you want to connect, and then click OK.
  3. Right-click a shape on your drawing page.
  4. 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

REFERENCES

For 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

Keywords: kbhowto kbhowtomaster KB319984