Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

list of tables in external database 1

Status
Not open for further replies.

waldemar

Programmer
Nov 15, 2001
245
DE
I am working with an application database <-> data database model and would like to connect ALL tables in the external database.

How do I get to the external tabledefs LIST?

Is it neccessary to close the currentdb, reopen the external one, collect the tabledefs.names, reopen the currentdb and tablefeds.connect each - or is there an easier way?

Thanks in advance
waldemar
 
Hi!

I think I may have understood the problem too simplistically but it sounds like all you need to do is go to the database window and click on new table. Choose link tables and use the window that pops up to find the external database. Choose select all and then link them. I get the feeling that I must be missing something.

hth Jeff Bridgham
bridgham@purdue.edu
 
Hi jeff,

well of course I want to it in vba (working with different external databases)...

regards
 
Hi again!

Thought that was too simple. You should be able to access the tabledefs collection once you open a connection to the database. The following loop should get you started:

Dim tbl As Table

For Each tbl in YourExternalDatabase.Tabledefs
Set the connection string using tbl.Name
Next tbl

hth Jeff Bridgham
bridgham@purdue.edu
 
hey thanks,

I found what i was missing now: dbengine.opendatabase... :)))

thanks again
waldemar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top