首页 | 新闻中心| 公司介绍| 产品走廊| 渠道与销售| 技术支持| 下载中心| 用户认证
蓝色快车PB俱乐部论坛--PowerDesigner浏览:PowerDesigner11中批量根据对象的name生成comment的脚本
>>欢迎您,请先登陆 | 注册 | 发贴排行 | 搜索 | 帮助 | 退出
    蓝色快车PB俱乐部论坛
    PowerDesigner
       浏览:11中批量根据对象的name生成comment的脚本

  发表一个新主题  发表一个新投票 回复主题  您是本帖的第 18635 个阅读者
 * 贴子主题: PowerDesigner11中批量根据对象的name生成comment的脚本 保存该页为文件 报告本帖给版主 显示可打印的版本  把本贴加入论坛收藏夹  把本贴加入IE收藏夹 

 掉线,给我留言吧!  随风
 头衔:侠之大者
  
  
  等级:版主
 财产:2380
 经验:1564
 魅力:1600
  注册:2003-6-30
  文章:83
  鉴定:保密

  给随风发送一个短消息 查看随风的个人资料 搜索随风在PowerDesigner的所有贴子  点击这里发送电邮给随风 引用回复这个贴子 

发贴心情 PowerDesigner11中批量根据对象的name生成comment的脚本
'******************************************************************************
'* File:     name2comment.vbs
'* Purpose:  Database generation cannot use object names anymore 
'            in version 7 and above.
'            It always uses the object codes.
'
'            In case the object codes are not aligned with your 
'            object names in your model, this script will copy 
'            the object Name onto the object comment for 
'            the Tables and Columns.
'
'* Title:    把对象name拷入comment属性中
'* Version:  1.0
'* Author:wangnc
'* 执行方法:PD11 -- Open PDM -- Tools --  Execute Commands -- Run Script
'******************************************************************************

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 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
         tab.comment = tab.name
         Dim col ' running column
         for each col in tab.columns
            col.comment= col.name
         next
      end if
   next

   Dim view 'running view
   for each view in folder.Views
      if not view.isShortcut then
         view.comment = view.name
      end if
   next

   ' go into the sub-packages
   Dim f ' running folder
   For Each f In folder.Packages
      if not f.IsShortcut then
         ProcessFolder f
      end if
   Next
end sub


发贴时间: 2006/12/19 9:56:49 保密

页次:1/1页每页10 本主题贴数1

分页: [1]

 *快速回复:PowerDesigner11中批量根据对象的name生成comment的脚本 顶端 
你的用户名:   还没注册? 密码:   忘记密码?请与管理员联系
内容
  • HTML标签: 不可用
  • UBB标签: 允许
  • 贴图标签: 允许
  • Flash标签:允许
  • 表情字符转换:允许
  • 上传图片:允许
  • 最多16KB
  • 邮件回复 显示签名  [Ctrl+Enter直接提交贴子]

    ">