|
-
Sep 28th, 2006, 10:36 AM
#1
Thread Starter
Junior Member
Creating relations with ADOX like in MS Access
Hello folks,
The following code creates a 1:n relation with referential integrity with the ADOX:
VB Code:
With objKey
.Name = "users/patients"
.Type = adKeyForeign
.RelatedTable = "users"
.Columns.Append "user_id"
.Columns("user_id").RelatedColumn = "user_id"
.DeleteRule = adRICascade
.UpdateRule = adRINone
End With
Cat.Tables("patients").Keys.Append objKey
where the "objKey" is ADOX.Key object and the "cat" is the ADOX.Catalog object.
What I want to know is, how should I code if I want to have:
1) a relation without referential integrity (easy to do manually in MS Access: means not to check ref. integrity checkbox on the dialog when creating a new relation),
2) a 1:1 relation (in MS Access means drop a field into same named field in other table and they are both primary keys),
3) a relation with a different join type (in MS Access means change the join type under 'edit relationships')
Can anybody help me? Any code snippet, link, etc. is highly appreciated and welcome!
Thank you for anwers in advance!
Best regards,
Bela
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|