cancel
Showing results for 
Search instead for 
Did you mean: 

changing attribus in PowerDesigner via vba-script

Former Member
0 Kudos

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?

Accepted Solutions (0)

Answers (2)

Answers (2)

GeorgeMcGeachie
Active Contributor
0 Kudos

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.

former_member200945
Contributor
0 Kudos

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