You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Description

Creates a relationship. Valid relationship types are: 0 = Identifying, 1 = NonIdentifying, 2 = NonSpecific, 3 = NonIdentifying Optional, 8 = Containment (MongoDB only). PARAMETERS: ParentEntity (String or Integer), ChildEntity (String or Integer), Relationship (Integer).

Syntax

Public Function Add( _
   ByVal ParentEntity As Variant, _
   ByVal ChildEntity As Variant, _
   ByVal RelationshipType As Variant _
) As Relationship

Parameters

  • ParentEntity
  • ChildEntity
  • RelationshipType

Example

Dim MyModel As Model
Dim MyRel As Relationship
Dim strParent As String
Dim strChild As String
Dim RelType As Integer

' Naming the parent and child in the relationship

' Setting RelType to 5 indicates that the relationship type is mandatory

strParent = "authors"
strChild = "titles"
RelType = 5

Set MyRel = MyModel.Relationships.Add(strParent, strChild, RelType)



  • No labels