Link to home
Start Free TrialLog in
Avatar of Crystal Rouse
Crystal RouseFlag for United States of America

asked on

Visio: Linking Data to Shapes from a SQL Database

I have a stencil with multiple shapes, some of which are grouped and contained multiple shapes within the group.
These stencil shapes already have shape data entered.  Now, I need to create a Database to store the data and I have read and watched enough tutorials to know how to link a database to a shape.  

What I am not sure of is how to obtain the data from the shape to populate my database?

Thank You!
Avatar of Scott Helmers
Scott Helmers
Flag of United States of America image

Do you want to extract data from the masters in the stencil? Or from instances of the shapes that are on the drawing page?

If the latter, you might be able to use the built-in reporting capability in Visio to write the data to Excel or XML and then import it into your database. Or you could modify the code from this previous question to write the data directly to SQL.

If you want to extract data from masters in the stencils, the concepts are the same as extracting data from shapes on the page -- but the setup is a bit different.

Let me know which you are trying to accomplish and we'll take it from there.
Please clear that which version of VISIO you are using and what the steps you are performing for hte same. By the way go this one may it help yours https://support.microsoft.com/en-us/kb/319984
Avatar of Crystal Rouse

ASKER

Thank you for both responses.

I have Visio 2013.  We have probably at least 100 or more shapes already created in a stencil with Shape Data already entered. Some of the shapes are grouped, but not all of them.

I need to export this data to a database so I don't have to manually input all of it again.  After importing to a new database schema, I want to link the database to the stencil shapes to keep them up to date going forward.  Eventually will use the database for online reports and forms.  This is the first step to getting to our end goal.

Thank You!
ASKER CERTIFIED SOLUTION
Avatar of Jason clark
Jason clark
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I can't go back to a previous version.  I'll export the data so that I can import into a database.  But, now if I understand you correctly when I link the data to the  Shapes, the data in the database will overwrite the date already stored in the Shape Data?

Just trying to make sure I understand what will happen.  I need to review with this the entire team so we can decide what to do next.

Thank You!
Crystal -- I started to provide additional thoughts last week and never finished...

The general purpose of the data linking feature in Visio is to connect shapes on the drawing page to data so that the diagram can be refreshed whenever the data changes. In essence, data linking is an import feature -- the assumption is that you want to overwrite the data in your shapes as the values in the data source are updated.

It sounds like your goal is to back up the data in your existing master shapes, so that you can more easily recreate your masters. Is that correct?

If so, you will need to write code to extract the data from your masters and then either 1) write it to an intermediate file type, like Excel, from which you can import to your database, or 2) write additional code to write it directly to a database.

Having done that you probably could use data linking to create fields and values in a set of shapes on the drawing page. In this instance, data linking would serve a one-time purpose. After you have the shapes the way you want them, you could drag each shape into a custom stencil to create new masters.

I'm making some assumptions about what you're trying to accomplish but let me know if this is getting close to what you want.
Yes, that is exactly what I will need to do.  Thanks for your inputs!