delete external DB's table from current DB? 
Author Message
 delete external DB's table from current DB?

I'd like to make it so that a macro I run deletes a table in an external
database before doing several other operations.

Is this a possibility with macros?  If not, is there relatively easy code
that will work it out?

Thanks in advance.




Mon, 17 Sep 2001 03:00:00 GMT  
 delete external DB's table from current DB?
In its purest form

Sub DelTbl()
Dim db As Database
Set db = OpenDatabase("<Name of DB with PATH>")
db.TableDefs.Delete ("<Name of table in db>")
End Sub

This does not address errors for invalid path, file not found, table not
found, etc...

Maybe resume next error handler...

HTH

Rich

Quote:

>I'd like to make it so that a macro I run deletes a table in an external
>database before doing several other operations.

>Is this a possibility with macros?  If not, is there relatively easy code
>that will work it out?

>Thanks in advance.





Mon, 17 Sep 2001 03:00:00 GMT  
 delete external DB's table from current DB?

Quote:
> Sub DelTbl()
> Dim db As Database
> Set db = OpenDatabase("<Name of DB with PATH>")
> db.TableDefs.Delete ("<Name of table in db>")
> End Sub

Will this keep the db that the user is currently in open?  I mean, in all
my past experience, opening an external db from within one always closes
the current one in order to open the external one.  When I run this
procedure as a first step in a larger sub, will the db the the code's in
stay open?

Thanks.



Sat, 22 Sep 2001 03:00:00 GMT  
 delete external DB's table from current DB?
Hi,

The GUI will stay the same, basically db will be just a reference (an alias)
to a (another) database.

Vanderghast, Access MVP.


Quote:

> > Sub DelTbl()
> > Dim db As Database
> > Set db = OpenDatabase("<Name of DB with PATH>")
> > db.TableDefs.Delete ("<Name of table in db>")
> > End Sub

> Will this keep the db that the user is currently in open?  I mean, in all
> my past experience, opening an external db from within one always closes
> the current one in order to open the external one.  When I run this
> procedure as a first step in a larger sub, will the db the the code's in
> stay open?

> Thanks.



Sat, 22 Sep 2001 03:00:00 GMT  
 delete external DB's table from current DB?

says...

Quote:

> > Sub DelTbl()
> > Dim db As Database
> > Set db = OpenDatabase("<Name of DB with PATH>")
> > db.TableDefs.Delete ("<Name of table in db>")
> > End Sub

> Will this keep the db that the user is currently in open?  I mean, in all
> my past experience, opening an external db from within one always closes
> the current one in order to open the external one.  When I run this
> procedure as a first step in a larger sub, will the db the the code's in
> stay open?

Yes, because the database is only being opened into an object variable,
rather than the user interface.

--
Paul Bredbury, http://dialspace.dial.pipex.com/brebs/



Sat, 22 Sep 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Can't Delete Tabledef in external DB

2. Backing up tables to external access db's

3. Coping current record to external DB?

4. How to copying from one DB table to another DB table

5. Copying Tables from one DB to another DB

6. How to copy table from DB to DB?

7. copy runtime a table from db a to db b

8. Copy table from one db to another db with vb5

9. Copy Access/Oracle table from one DB to another DB.

10. Copying table from DB to DB in VB

11. Copy table schema and data from one DB to another DB

12. How to delete all tables in a db

 

 
Powered by phpBB® Forum Software