Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Delete a relationship (Access 2000)

    Delete a relationship


    My problem is deleting a relationship through code. I have a function tthat delets a table in anothe r database, however i receive the message cannot delete the table isnce it is used in relationship.My table is called Products and it is related to the table Order Details in one to many relationship, i.e. the table Products has an unique ProductID number.Is there any way to put some code for deletion of the relationship before deleting the table itself?

    Dim cat As New ADOX.Catalog, objConn As New ADODB.Connection
    objConn.Open "Provider= Microsoft.Jet.OLEDB.4.0;Data Source = C:bestorebe.mdb"
    With cat
    .ActiveConnection = objConn
    .Tables.Delete "products"
    End With

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Delete a relationship (Access 2000)

    Actually, your problem us that you will orphan records in a dependent table if you succeed in deleting the relationship. Referential integrity has been enforced between the two tables. Why are you trying to violate it?
    Charlotte

  3. #3
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Delete a relationship (Access 2000)

    Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •