Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    cannot delete in remote database (Access 2000)

    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:bestorebe.mdb"
    With cat
    .ActiveConnection = objConn
    .Tables.Delete "products"
    End With


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

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

    Re: cannot delete in remote database (Access 2000)

    Is it related to other tables? If so, you'll have to delete the relationships first before you can delete the table. That, of course, can potentially damage the data integrity of the remote database. Are you just trying this out as a test or do you need to do this in production for some reason? If it's really needed, you'll have to explain what you're tyring to accomplish so someone can help you further.
    Charlotte

  3. #3
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: cannot delete in remote database (Access 2000)

    Thank you for your reply and your kind attention.We ( our business company have one and the same dataabse in several cities.We want to change the table products by sending to them a small code to delete the table and replace it with another table This saves us a lot of work,visitng the place.etc..Our code is very efficient for other objects as modules etc, and also for unrelated tables,but we cannot solve the problem with the relationship we have just mentioned.The table products is related with the table order details in one to many relationship.Is it possible to delete this relationship and then restore it again?.

    Kind regards

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

    Re: cannot delete in remote database (Access 2000)

    It would be a bad idea to do it that way. You could easily wind up orphaning records in those remote databases if you removed a product. A better way would be to send them your table along with an update query to append all the products that don't already exist in their table. Then delete the table you sent. That leaves the relationships intact and adds the new products that might be missing.
    Charlotte

Posting Permissions

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