您的位置:首页 > 其它

在Powerdesigner中,根据已有字段的Name值替换Code相同的Name的值

2008-09-04 14:14 369 查看
如果在powerdesigner中有一个表我已经把名子和你码对应好了.

比如Name是年,Code是year,那么怎么把别的表中的Code是Year的Name设成年呢?

用以下代码即可,哈哈.调好了.

Dim nb

nb=ActiveSelection.Count

if nb=0 then

Output "No selected Objects"

end if

dim obj

Dim d '创建一个变量 and (not d.Exists(col.Code))

Set d = CreateObject("Scripting.Dictionary")

for Each obj in ActiveSelection

for each col in obj.Columns

if (col.Code<>col.Name) and (not d.Exists(col.Code))then

Output "--"+obj.Name+"."+obj.Code+"="+col.Name+"."+col.Code

d.Add col.Code,col.Name

end if

next

next

for Each obj in ActiveSelection

for each col in obj.Columns

if (col.Code=col.Name) and (d.Exists(col.Code) )then

Output col.Name+"."+col.Code+"."+d.Item(col.Code)

col.Name=d.Item(col.Code)

end if

next

next
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐