Connecting Tech Pros Worldwide Help | Site Map

How can I create a list of another database's objects?

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 26th, 2007, 12:55 AM
G Gerard
Guest
 
Posts: n/a
Default How can I create a list of another database's objects?

Hello



I am trying to connect to a msaccess database and then create a list of the
objects in that database (more specifically the tables) and then create a
list of the fields (including the field type) for each table.



How can I do this?



Thanks

G Gerard



  #2  
Old March 26th, 2007, 01:15 AM
storrboy
Guest
 
Posts: n/a
Default Re: How can I create a list of another database's objects?

On Mar 25, 7:50 pm, "G Gerard" <gger...@nbnet.nb.cawrote:
Quote:
Hello
>
I am trying to connect to a msaccess database and then create a list of the
objects in that database (more specifically the tables) and then create a
list of the fields (including the field type) for each table.
>
How can I do this?
>
Thanks
>
G Gerard

You should be able to get at the different collections through the
database object (assuming DAO) like you would using CurrentDB.

Set db = (method of opening/creating database)
db.TableDefs()
db.QueryDefs()
db.Documents("Forms").Document()

and so on.

May I ask why?

  #3  
Old March 26th, 2007, 02:15 AM
Allen Browne
Guest
 
Posts: n/a
Default Re: How can I create a list of another database's objects?

OpenDatabase() on the file name.
Table names are in MSysObjects.
Loop through the TableDefs to show the field names and types.

An example of how to list the fields, types, and descriptions for tables:
http://allenbrowne.com/func-06.html

This is a more comprehensive example:
http://allenbrowne.com/AppIssueChecker.html
Illustrates how to:
- choose a database, and OpenDatabase;
- loop through the TableDefs, and examine each field, including the names
and properties of the database, tables, and fields;
- do a bunch of other stuff as well.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"G Gerard" <ggerard@nbnet.nb.cawrote in message
news:KNENh.15290$PV3.157535@ursa-nb00s0.nbnet.nb.ca...
Quote:
>
I am trying to connect to a msaccess database and then create a list of
the objects in that database (more specifically the tables) and then
create a list of the fields (including the field type) for each table.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.