cannot delete in remote database


I am trying to delete a table in a remote database and i receive the following:
Runtime error -2147467259(80004005)
Canot create this index or table.It is either the current index or is used in relationship.

I use the following code:


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


How can i change my code so that i can delete the table?

Comments

  • : How can i change my code so that i can delete the table?


    I'm not very good in VB but did you make sure the table "products" has no related tables? The "Products" can't be the primary table that has related records. If so it makes sense that your code will give an error because it'll violate reference integrity.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion