Create relationship without enforcing Referential Integrity 
Author Message
 Create relationship without enforcing Referential Integrity

Howdy folks.

I am using VB to create an Access database by using ADOX. I would like to
create a relationship between various tables, but not enforce referential
integrity (set it to False)

A sample of my code is shown below:

--------------------------------------------------------
  Set catCatalog = New ADOX.Catalog
  Set kyForeign = New ADOX.Key

  Set catCatalog.ActiveConnection = pConnectionOut

  With kyForeign
    .Name = "Phone/Member"            ' Name of the Relationship
    .Type = adKeyForeign
    .RelatedTable = "Member"    ' Name of Linked table (1 in the 1 to Many
relationship)
    .Columns.Append "ParentID"  ' Column Name used in relationship
    .Columns("ParentID").RelatedColumn = "MemberID" ' Name of the related
column in the related table
    .UpdateRule = adRINone
    .DeleteRule = adRINone
  End With

  catCatalog.Tables("Phone").Keys.Append kyForeign

--------------------------------------------------------

I can set the Update and Delete rules to None, but looking at the database
afterwards RI is always enforced (a tick is in the checkbox). Is it possible
to create relationships in the way that I want? If so could you please give
me some pointers or let me know of any good documentation.

Thank you

Regards,
Steve.



Mon, 04 Oct 2004 23:10:07 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Enforce Referential Integrity

2. Problems Enforcing Referential Integrity using Autonumber field

3. Enforce referential integrity in a disconnected recordset?

4. Enforcing Referential Integrity

5. Enforce Referencial Integrity by code

6. Transaction w Referential Integrity Problem

7. Nulls in Referential Integrity

8. Referential Integrity

9. Referential Integrity

10. Referential Integrity violations being allowed: BUG????

11. Deleting and Referential Integrity

12. Referential Integrity - changing in linked tables

 

 
Powered by phpBB® Forum Software