PowerDesigner中pdm物理模型中 Name和Comment相互转换
在使用PowerDesigner对数据库进行概念模型和物理模型设计时,一般在Name或Comment中写中文,在Code中写英文。Name用来显示,Code对应数据库中的列名,Comment中的文字会保存到数据库Table或Column的Comment中,当Name已经存在的时候,再写一次 Comment很麻烦,可以使用以下代码来解决这个问题。 另外在使用REVERSE ENGINEER从数据库反向生成PDM的时候,PDM中的表的Name和Code事实上都是Code,为了把Name替换为数据库中Table或Column的中文Comment,可以使用以下脚本。 1、将Name中的内容复制至Comment中 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 current model is not an