Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    delete a table in a relationship (Access 2000)

    Cannot delete a table due to a relationship


    The following code gives me a message that the table Products
    participates in a relationship, and i cannot delete the table.
    How can i improve the code so that the tanle will be deleted?


    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
    Star Lounger
    Join Date
    Sep 2001
    Location
    SC, USA
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: delete a table in a relationship (Access 2000)

    Do you really need to actually delete the table? If you're just trying to start fresh, you could run a delete query and delete all the records instead.

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: delete a table in a relationship (Access 2000)

    If a table participates in a relationship, it cannot be deleted until the relationship is deleted. Period! That said, do you need the relationship in your database? If you are deleting all the records, it would seem not.

    Wendell Bell
    Wendell

Posting Permissions

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