PowerDesinger 从数据库中依赖反转出来的PDM修改。修改显示名字 将注释加到PDM工程

本文介绍了一种使用 VBA 在 Physical Data 模型中批量更新表名的方法。此过程包括检查当前模型的有效性,并通过在表名后添加其代码和注释来更新表名及其列名。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1. Option   Explicit   
  2.   ValidationMode   =   True   
  3.   InteractiveMode   =   im_Batch   
  4.     
  5.   Dim   mdl     
  6.     
  7.     
  8.   Set   mdl   =   ActiveModel   
  9.   If   (mdl   Is   Nothing)   Then   
  10.         MsgBox   "There   is   no   current   Model"   
  11.   ElseIf   Not   mdl.IsKindOf(PdPDM.cls_Model)   Then   
  12.         MsgBox   "The   current   model   is   not   an   Physical   Data   model."   
  13.   Else   
  14.         ProcessFolder   mdl   
  15.   End   If   
  16.     
  17.   Private   sub   ProcessFolder(folder)   
  18.         Dim   Tab   
  19.         for   each   Tab   in   folder.tables   
  20.               if   not   tab.isShortcut   then   
  21.                     if   (not   isnull(tab.code))   and   (trim(tab.code)<>"")   then   
  22.                           tab.name = tab.code + " : " + tab.comment     
  23.                     end   if   
  24.                     On   Error   Resume   Next   
  25.                     Dim   col     
  26.                     for   each   col   in   tab.columns   
  27.                     if   (not   isnull(col.name))   and     (trim(col.name)<>"")       then   
  28.                           col.code=   col.name   
  29.                     end   if   
  30.                     if   (not   isnull(col.comment))   and     (trim(col.comment)<>"")       then   
  31.                           col.name=   col.name +" : "+col.comment   
  32.                     end   if   
  33.                     On   Error   Resume   Next   
  34.                     next   
  35.               end   if   
  36.         next       
  37.   end   sub   

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值