• delete a table in a relationship (Access 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » delete a table in a relationship (Access 2000)

    Author
    Topic
    #357407

    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

    Viewing 1 reply thread
    Author
    Replies
    • #540265

      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.

    • #540267

      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

    Viewing 1 reply thread
    Reply To: delete a table in a relationship (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: