Check out the SchemaRelationship object in the Object Browser. It has properties like OneSide, ManySide; etc. I messed with this several years ago, and it seems like I was able to create and modify relationships in code, but don't remember the particulars, or even what database I was working in.
Tranman