Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Delete table in remote database (Access 2000)

    I have a function to rename a macro in remote database.Is it possible to use this function also to delete the table calls and the form frmCalls in the remote database ?
    Public Function RenameMacro()
    Dim strPassword As String
    Dim strDatabase As String
    Dim app As New Access.Application
    Dim dbs As DAO.Database
    On Error GoTo ErrHandler

    strDatabase = "c:benew.mdb"
    strPassword = "Secret"
    Set dbs = app.DBEngine.OpenDatabase(strDatabase, , , ";PWD=" & strPassword)
    app.OpenCurrentDatabase strDatabase
    app.DoCmd.Rename "Macro2", acMacro, "Macro1"

    ExitHandler:
    On Error Resume Next
    dbs.Close
    Set dbs = Nothing
    app.Quit
    Set app = Nothing
    Exit Function

    ErrHandler:
    MsgBox Err.Description, vbExclamation
    Resume ExitHandler
    End Function

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Delete table in remote database (Access 2000)

    You can add lines with app.DoCmd.DeleteObject. Look up DeleteObject in the VBA help to see the exact syntax needed.

Posting Permissions

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