cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Adding a left/right mapped item

jpots
Super Contributor

Hello,

I've got to create a mapping for a database via a VB script. I am able to make the mapping, but I still have to link this mapping to that particular database:

Red = new mapping // Green = existing mappingRed = new mapping // Green = existing mapping

I cannot find the objects with these left and right root mapped elements:

set oMapType = myRoot.GetSelection("Select [_MappingType] where name = " & DQ & "Logical/Physical" & DQ)

'MyRoot.MessageBox oMapType.count, "Mapping Type"

if oMapType.count = 1 then
set iMapType = oMaptype(1)
set aDuplicateObject = iMapType.Getcollection("Mapping").add("Mapping of " & DBName)

'... --> here we should add code to link the left and right mapped elements

end if

 Can anyone help me how to retrieve these objects?

tnx,

Jeroen

2 Replies

jpots
Super Contributor

It was as simple as that... except 1 small addition, I had to add the 'add'-command to the line...

set MappedItem = aDuplicateObject.GetCollection("Left Root Mapped Element").add(objMega)
set MappedItem = aDuplicateObject.GetCollection("Right Root Mapped Element").add(objMega)

KennethB
MEGA
MEGA

Jeroen,

It should be as simple as

set aLeftMap = aDuplicateObject.GetCollection("Left Root Mapped Element").Item(1)

(though you should use the absolute identifier of the end point, and check for the number of items in the collection)

 

Kenneth