Urgent: Create ERD, Add Entities & Relationships using VBA

B

BigJ

I have spent the past 4-5 hours trawling Google web & groups in vain,
looking for info. I want to do the following in VBA in Visio 2003
Professional:

1. Create a new ER diagram
2. Create two entities
3. Add some fields to each entity, specifying basic details (data
type, required, primary key)
3. Create a relationship between the two entities

I can do these things manually in my version of Visio 2003
Professional (i.e. in the UI), but I need to automate the procedure. I
would have thought this should be basic and universal!

PLEASE could someone assist.

I'd appreciate if anyone can suggest a GOOD reference that definitely
covers this stuff.
 
A

Al Edlund

Unfortunately there is no published api (AFAIK) for the database tools in
Visio. The tasks that you have defined however are not unique to database
- create shape
- add custom information
- add connection between the shapes
There are examples in the visio sdk for these
al
 
B

BigJ

OK this is strange. I'm viewing this newsgroup in Google Groups. The
thread "treeview" shows two messages, the second of which is a post by
Al Edlund. But I can only see my original message contents. There is
no second message displayed. This is a pity since if anyone has
replied I'm very keen to see what they wrote! Ed, if you don't mind,
would you please re-submit your post. Hopefully I'll be able to access
the contents.

Thanks.
 
B

BigJ

I have spent the past 4-5 hours trawling Google web & groups in vain,
looking for info. I want to do the following in VBA in Visio 2003
Professional:

1. Create a new ER diagram
Al,

I managed to read your post using a different news reader (for some
reason it is not showing in Google Groups).

I have found no methods for setting (or reading) database properties
for shapes in an ER diagram. If you are able to point me in the right
direction I'd really appreciate it.

BigJ.
 
A

Al Edlund

The information in a visio ER diagram is only part of the data, some of it
is kept in an internal data store that is not accessible. One technique that
is sometimes used is to save the drawing as xml and then parse out what is
available. There is no published API to write against.
Sorry,
al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top