PowerDesigner writes Name to the PD7 in Comment.

Background:

I used PowerDesigner when developing projects recently. It is very uncomfortable to look at the fields in the database design, because the Chinese people still like to read Chinese. , So I made a small change.


First look at the effect before the change:

How to change it to what we want?

see the following step by step Explanation:

Step 1: Double-click the table and the following interface will appear: We call the Commont field:




Step 2:

< span style="font-family:KaiTi_GB2312; font-size:18px">


The third step: execute the code as shown below:


The code is as follows:

Option Explicit ValidationMode = True InteractiveMode = im_Batch Dim mdl'the current model'get the current active model Set mdl = ActiveModel If (mdl Is Nothing) Then MsgBox "There is no current Model" ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then MsgBox "The cu rrent model is not an Physical Data model." Else ProcessFolder mdl End If'This routine copy name into code for each table, each column and each view'of the current folder Private sub ProcessFolder(folder) Dim Tab'running table for each Tab in folder.tables if not tab.isShortcut then if len(tab.comment) <> 0 then tab.name = tab.comment end if On Error Resume Next Dim col'running column for each col in tab.columns if len(col .comment) <>0 then col.name =col.comment end if On Error Resume Next next end if next end sub 


The execution result is shown in the figure:


This blog is written here because of time. Generally, programmers in enterprises develop in this way, but there are still some lows. Will continue to be updated in the future.


Leave a Comment

Your email address will not be published.