Howdy, Stranger!

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


cannot delete in remote database

freelancefreelance Member Posts: 26

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?


  • aznwildkataznwildkat Member Posts: 139
    : 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.

  • Andre YoungAndre Young USAMember Posts: 0

    ( ) free ebooks and video tutorials about ( Scratch, PHP, MATLAB, R, Visual Basic, Objective-C, Swift, C#, Delphi, Assembly, Visual Basic .NET, Go, Ruby, Java, PL/SQL, C, Python, Perl, JavaScript, C++ ABAP, Awk, SAS, Ada, Hack, Apex, Scheme, Prolog, F#, Fortran, Lisp, Bash, VBScript, Transact-SQL, FoxPro, Clojure, Crystal, Julia, Alice, Erlang, Dart, D, Kotlin, Lua, ML, Rust, COBOL, LabVIEW, Logo, Scala ) ___

Sign In or Register to comment.