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