sphere_monk
Registered User.
- Local time
- Today, 14:24
- Joined
- Nov 18, 2002
- Messages
- 62
Is it possible to use VB to delete a table in a different database?
I have one database(DB1) (the database the code resides in) that needs to take tables from a second database(DB2) and (periodically) copy them into a third database(DB3). I am planning to create a form with a command button that performs the following steps to accomplish this:
The problem that I see is that at step 2, if the table in DB3 already exists, then DoCmd.CopyObject will put a (1) at the end of the tablename. I need to get rid of the old table in DB3 first.
Does anyone know of a way to do this from DB1?
Any help would be appreciated.
I have one database(DB1) (the database the code resides in) that needs to take tables from a second database(DB2) and (periodically) copy them into a third database(DB3). I am planning to create a form with a command button that performs the following steps to accomplish this:
- Import the tables as temp tables from the DB2 into DB1 using DoCmd.TransferDatabase acImport.
- Copy the tables from DB1 into DB3 using DoCmd.CopyObject.
- Delete the temp tables from step 1, using DoCmd.DeleteObject.
The problem that I see is that at step 2, if the table in DB3 already exists, then DoCmd.CopyObject will put a (1) at the end of the tablename. I need to get rid of the old table in DB3 first.
Does anyone know of a way to do this from DB1?
Any help would be appreciated.