PowerDesigner->Tools->Execute Commands->Edit/Run Scripts

 

代码一:将Name中的字符COPY至Comment中

【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
'****************************************************************************** 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码'
*    File:            name2comment.vbs 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码'
*    Purpose:      Database    generation    cannot    use    object    names    anymore   
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码'
                          in    version    7    and    above. 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码'
                          It    always    uses    the    object    codes. 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码'
 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码'
                          In    case    the    object    codes    are    not    aligned    with    your   
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码'
                          object    names    in    your    model,    this    script    will    copy   
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码'
                          the    object    Name    onto    the    object    Comment    for   
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码'
                          the    Tables    and    Columns. 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码'
 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码'
*    Title:         
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码'
*    Version:      1.0 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码'
*    Company:      Sybase    Inc.   
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码'
****************************************************************************** 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码

【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
Option   Explicit 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码ValidationMode   
=   True 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码InteractiveMode   
=    im_Batch 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
Dim    mdl   '    the    current    model 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码

【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
'    get    the    current    active    model 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
Set    mdl   =    ActiveModel 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
If    (mdl   Is   Nothing)   Then 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码      
MsgBox   "There    is    no    current    Model " 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
ElseIf   Not    mdl.IsKindOf(PdPDM.cls_Model)   Then 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码      
MsgBox   "The    current    model    is    not    an    Physical    Data    model. " 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
Else 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码       ProcessFolder    mdl 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
End   If 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
'    This    routine    copy    name    into    comment    for    each    table,    each    column    and    each    view 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码'
    of    the    current    folder 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
Private   sub    ProcessFolder(folder) 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码      
Dim    Tab   'running      table 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
      for   each    Tab    in    folder.tables 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码            
if   not    tab.isShortcut   then 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码                   tab.comment   
=    tab.name 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码                  
Dim    col   '    running    column 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
                  for   each    col    in    tab.columns 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码                         col.comment
=    col.name 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码                  
next 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码            
end   if 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码      
next 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码      
Dim    view   'running    view 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
      for   each    view    in    folder.Views 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码            
if   not    view.isShortcut   then 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码                   view.comment   
=    view.name 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码            
end   if 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码      
next 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码      
'    go    into    the    sub-packages 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
      Dim    f   '    running    folder 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
      For   Each    f    In    folder.Packages 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码            
if   not    f.IsShortcut   then 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码                   ProcessFolder    f 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码            
end   if 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码      
Next 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
end   sub
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码

代码二:将Comment中的字符COPY至Name中

【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码Option   Explicit 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码ValidationMode   
=   True 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码InteractiveMode   
=    im_Batch 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
Dim    mdl   '    the    current    model 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码

【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
'    get    the    current    active    model 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
Set    mdl   =    ActiveModel 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
If    (mdl   Is   Nothing)   Then 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码      
MsgBox   "There    is    no    current    Model " 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
ElseIf   Not    mdl.IsKindOf(PdPDM.cls_Model)   Then 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码      
MsgBox   "The    current    model    is    not    an    Physical    Data    model. " 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
Else 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码       ProcessFolder    mdl 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
End   If 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
Private   sub    ProcessFolder(folder) 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
On Error Resume Next
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码      
Dim    Tab   'running      table 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
      for   each    Tab    in    folder.tables 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码            
if   not    tab.isShortcut   then 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码                   tab.name   
=    tab.comment
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码                  
Dim    col   '    running    column 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
                  for   each    col    in    tab.columns 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码                  
if col.comment="" then
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码                  
else
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码                         col.name
=    col.comment 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码                  
end if
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码                  
next 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码            
end   if 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码      
next 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码      
Dim    view   'running    view 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
      for   each    view    in    folder.Views 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码            
if   not    view.isShortcut   then 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码                   view.name   
=    view.comment 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码            
end   if 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码      
next 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码      
'    go    into    the    sub-packages 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
      Dim    f   '    running    folder 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
      For   Each    f    In    folder.Packages 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码            
if   not    f.IsShortcut   then 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码                   ProcessFolder    f 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码            
end   if 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码      
Next 
【转】PowerDesigner 中将Comment(注释)及Name(名称)内容互相COPY的VBS代码
end   sub

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
  • 2022-03-10
  • 2021-12-06
  • 2021-07-28
猜你喜欢
  • 2021-09-04
  • 2022-12-23
  • 2021-12-12
  • 2021-11-25
  • 2022-02-24
相关资源
相似解决方案