Question : Drop Table

Can someone give me code for dropping a table in another database?
I need it to do this from the current database:
1) Drop table "MyTbl" in C:\MyFolder\MyDB.accdb
2) Copy table "MyTblOriginal" in C:\MyFolder\MyDB.accdb and rename as "MyTbl" in  C:\MyFolder\MyDB.accdb

Also, in doing this, will dropping "MyTbl" corrupt the link I have to that table in my current database?  I'm basically trying to avoid a delete query because "MyTbl" is very large.  That's why it sits in a separate database.

Answer : Drop Table

try this codes, run from database A
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
Sub delObj()
On error resume next
Dim acc As Access.Application
 
Set acc = New Access.Application
acc.OpenCurrentDatabase "C:\MyFolder\MyDb.accdb"
acc.DoCmd.DeleteObject acTable, "MyTbl"
 
acc.DoCmd.CopyObject , "MyTbl", acTable, "Products"
acc.CloseCurrentDatabase
Set acc = Nothing
End Sub
Random Solutions  
 
programming4us programming4us