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

    How to delete a table from another database

    How to delete a table from another database

    I want to open a database from another database, and then delete the talble Orders in the opened database.However the code made by me doesn

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: How to delete a table from another database

    Hi,
    Try this:
    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 "orders"
    end with
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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