Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Posts
    34

    Unanswered: Delete table in another Database

    Hey All,

    I am trying to delete a table in a database that is located on the network from a database that is in a different location.

    Could someone please help.

    Thanks,
    SD

  2. #2
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    I am using Access 97 and this is how I delete tables in other databases. If you are using another version change the 8 to the appropriate number and hopefully it will still work.


    Dim objAccess8 As Object

    Set objAccess8 = CreateObject("Access.Application.8")
    objAccess8.OpenCurrentDatabase strDatabasePath, True
    objAccess8.DoCmd.DeleteObject acTable, strTableName
    DoEvents

    'Cleanup
    objAccess8.Quit
    Set objAccess8 = Nothing

  3. #3
    Join Date
    Dec 2002
    Posts
    34
    Originally posted by DCKunkle
    I am using Access 97 and this is how I delete tables in other databases. If you are using another version change the 8 to the appropriate number and hopefully it will still work.


    Dim objAccess8 As Object

    Set objAccess8 = CreateObject("Access.Application.8")
    objAccess8.OpenCurrentDatabase strDatabasePath, True
    objAccess8.DoCmd.DeleteObject acTable, strTableName
    DoEvents

    'Cleanup
    objAccess8.Quit
    Set objAccess8 = Nothing
    Thanks Man! Worked like a charm. You rock.

    SD

Posting Permissions

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