refresh shapes from database

Started by bernie.storrier, April 13, 2010, 01:05:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bernie.storrier

hi,

i have an access database (ms access 2003) that is used to provide the data to colour shapes on a visio diagram (visio 2003 pro).

i previously had a single diagram where this process worked successfully from a menu bar command button.  the bit of code from within the module is:

    'database refresh
   
    ActiveWindow.SelectAll

    Application.Addons("Database Refresh").Run (" ")
   
    Visio.Application.ShowChanges = True
    ActiveWindow.DeselectAll



i have now created a second diagram for another area that will be used for planning work in that area.  i created the second visio diagram simply by copying the first, renaming the file, re-arranging the shapes, assigning a different range of shapekey numbers so the same database can be used and updating the database with the shape information (Update Database Record).

when i try and run my refresh page command (above) it fails on the


    Application.Addons("Database Refresh").Run (" ")
   
line and generates the following error :

The table 'system diagram' specified in the selected shape does not exist in the ODBC data source.

i have run the database wizard and the link to database menu commands a few times, checked the database settings and it all seems to be correct.  the original visio diagram still functions from the same database with the code above.

what have i missed?

thanks for any help.

bernie

aledlund

some thoughts from the side
are both drawings open simultaneously on the same system (different systems). Have you used odbc troubleshooting aids (trace, logs, etc.). Have you considered creating a duplicate of your new db (with the updated fields) and connecting/testing your new drawing (get rid of interaction exposures).
al

bernie.storrier


al,

thanks for the repy. 

i have tried all sorts of tests, checks, logs, traces and still cannot identify the issue.  in the end i gave up and re-did the second diagram as a second page of the original diagram.  i can set the active page depending on values in the access database so that part is ok.

the important thing is that it works, although i'd still really like to know why it didn't............  time doesn't seem to allow me to try and discover the reasons.

again, thanks for the reply.

bernie