首页 | 新闻中心| 公司介绍| 产品走廊| 渠道与销售| 技术支持| 下载中心| 用户认证
蓝色快车PB俱乐部论坛--PowerDesigner回复发言
>>欢迎您,请先登陆 | 注册 | 发贴排行 | 搜索 | 帮助 | 退出
    蓝色快车PB俱乐部论坛
    PowerDesigner
       回复发言

  *为必填项目 常规论坛,只允许注册会员发言

用户名   *您没有注册?
密码   *忘记密码?请与管理员webmaster@besoft.com.cn联系
主题标题   不得超过 50 个汉字
当前心情
  • 将放在帖子的前面
  •                           
                              
    内容

    在此论坛中
  • HTML标签: 不可用
  • UBB标签: 允许
  • 帖图标签: 允许
  • Flash标签: 允许
  • 表情字符转换: 允许
  • 上传图片: 允许
  • 最多16KB

  • 粗体 斜体 下划线 居中 超级连接 Email连接 图片 Flash图片 Shockwave文件 realplay视频文件 Media Player视频文件 QuickTime视频文件 引用 飞行字 移动字 发光字 阴影字
    字体:      字体大小    颜色:
    点击表情图即可在帖子中加入相应的表情
     
    选项

    是否显示您的签名?
    有回复时使用邮件通知您?


     

    --  作者:随风
    --  发布时间:2006/12/19 9:56:49

    --  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


    ">