Skip to Content
0

changing attribus in PowerDesigner via vba-script

Apr 19, 2017 at 07:24 PM

68

avatar image

Hello,

I'm trying to copy the comment of a column of a table to the description of the same column. My script:

option explicitDim kind, name, obj, c, a
kind = InputBox("(T)able or (V)iew")
name = InputBox("Enter name")
If kind = "T" Then
Set obj = ActiveModel.FindChildByName(name, cls_table)
ElseIf kind = "V" Then
Set obj = ActiveModel.FindChildByName(name, cls_view)
End If
For each c in obj.columns
c.SetAttribute "Description", c.comment
Next

The problem is that I can see the new description when I open the column-object and look under "description", but can't see it in the table browser under "description". To see it there, I have to open every column an close it with the ok-button. Then the description appears in the table browser. Has it something to do with the object-hierarchy?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Phillip Lam
Apr 20, 2017 at 04:19 PM
0

I just try the code in 16.6 SP03 and it works fine.

Share
10 |10000 characters needed characters left characters exceeded
George McGeachie Apr 23, 2017 at 07:08 PM
0

This issue also occurs if you import descriptions using the Excel Import. The Description is visible in a list of objects if you include "Description Text", but not if you show the Description. I fix it by making any change to the object - I think that running validation event handlers also does the job.

Share
10 |10000 characters needed characters left characters exceeded