Can't append a relation with no fields defined. (Error 3366)
See Also
You are trying to append a CdbRelation object to a Relations collection, but the CdbRelation object has no fields.
To correctly append a Relation
-
Use the CreateRelation method to create the Relation object.
-
Set the Table, ForeignTable, and Attributes properties of the Relation object, if you did not specify them as arguments to the CreateRelation method.
-
Set the Table, ForeignTable, and Attributes properties of the Relation object, if you did not specify them as arguments to the CreateRelation method. Set the Name (if you did not specify it as an argument to the CreateField method) and ForeignName properties of the Field object or objects to the corresponding Name property settings of the primary key and the foreign key Field objects of each field in the relationship.
-
Use the Append method to save the Field object or objects in the Fields collection of the Relation object.
-
Use the Append method to save the Relation object in the Relations collection of the database.