print database fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
Is there a way to print all field names by tables within a database? I have
about 25 tables in the database and wondering if there is a way to dump all
field names. Not the values within, just the names. I am using Access 2000.
I have the database on other several different servers (at different
clients) and am trying to make it easier to change the tables in the offsite
databases before I publish to them.
Thanks,
Dave
 
Make sure you have a reference set to DAO (With any code module open, select
Tools | References from the menu bar, scroll through the list of available
references until you find the one for Microsoft DAO 3.6 Object Library, and
select it.). Then you can use something like:

Sub PrintAllTablesAndFields()
Dim dbCurr As DAO.Database
Dim tdfCurr As DAO.TableDef
Dim fldCurr As DAO.Field

Set dbCurr = CurrentDb()
For Each tdfCurr in dbCurr.TableDefs
If (tdfCurr.Attributes And dbSystemObject) = 0 Then
Debug.Print tdfCurr.Name & " contains:"
For Each fldCurr In tdfCurr.Fields
Debug.Print " " & fldCurr.Name
Next fldCurr
Debug.Print
End If
Next tdfCurr

Set fldCurr = Nothing
Set tdfCurr = Nothing
Set dbCurr = Nothing
End Sub
 
Hi Dave,

I created an Access Add-In called the "John Viescas Table Documentor"
that does exactly this. It is even easier to use than the built-in Access
Documentor and creates a slick report that will list each table (including
linked ones) and their field properties in an easy-to-read format. I recently
finished Version 2.0 of the add-in. This version even works on MDE files.

Once installed (takes less than a minute) all you have to do is
Tools | Add-Ins | John Viescas Table Documentor. Poof!
After a few seconds a slick report is displayed on the screen. Easy as pie!
The report will list each field's Name, Description, Type, Length, and
which field(s) is the Primary Key.

I am awaiting word back from John about the possibility of having him post
it on his web site where anyone can download it. In the meantime, I do not
believe he would have a problem if I sent you a copy. If you do wish to have
a copy please let me know where you would like it sent to (please mung the
e-mail address so you won't get spammed!). There is one version for Access
97 and one for 2000 which works with Access 2000, 2002, and 2003.
I will need to know which version you need.
 
If you print the Relationships window, would that get what you want?
Debbie

| Hello,
| Is there a way to print all field names by tables within a database? I have
| about 25 tables in the database and wondering if there is a way to dump all
| field names. Not the values within, just the names. I am using Access 2000.
| I have the database on other several different servers (at different
| clients) and am trying to make it easier to change the tables in the offsite
| databases before I publish to them.
| Thanks,
| Dave
 
Thank you for your help.

Douglas J. Steele said:
Make sure you have a reference set to DAO (With any code module open,
select Tools | References from the menu bar, scroll through the list of
available references until you find the one for Microsoft DAO 3.6 Object
Library, and select it.). Then you can use something like:

Sub PrintAllTablesAndFields()
Dim dbCurr As DAO.Database
Dim tdfCurr As DAO.TableDef
Dim fldCurr As DAO.Field

Set dbCurr = CurrentDb()
For Each tdfCurr in dbCurr.TableDefs
If (tdfCurr.Attributes And dbSystemObject) = 0 Then
Debug.Print tdfCurr.Name & " contains:"
For Each fldCurr In tdfCurr.Fields
Debug.Print " " & fldCurr.Name
Next fldCurr
Debug.Print
End If
Next tdfCurr

Set fldCurr = Nothing
Set tdfCurr = Nothing
Set dbCurr = Nothing
End Sub
 
Thanks Jeff,
I would appreciate the code. Thanks for your help.
i am at (e-mail address removed)
Dave
 
Thanks Debbie,
The problem is that I need the values as well. Unless I am doing something
wrong, what you suggested does not give me those.
Thanks,
Dave
 
Sorry, your post stated ... "Not the values within, just the names."


| Thanks Debbie,
| The problem is that I need the values as well. Unless I am doing something
| wrong, what you suggested does not give me those.
| Thanks,
| Dave
| | > If you print the Relationships window, would that get what you want?
| > Debbie
| >
| > | > | Hello,
| > | Is there a way to print all field names by tables within a database? I
| > have
| > | about 25 tables in the database and wondering if there is a way to dump
| > all
| > | field names. Not the values within, just the names. I am using Access
| > 2000.
| > | I have the database on other several different servers (at different
| > | clients) and am trying to make it easier to change the tables in the
| > offsite
| > | databases before I publish to them.
| > | Thanks,
| > | Dave
 
Sorry Debbie,
Sometimes I write things too quickly and don't explain myself well. I meant
not the values entered into the database through the form. I am not good at
detail as you can see.

Thanks,
Dave
 
Hi Dave,

Files have been sent to the address you provided.
Subject line will be:
"Access Add-In You Requested From The Newsgroup"
Follow these steps to install the Add-In and/or read the attached
Word document:

1. Unzip the file JVTableList.MDA to your Office or Access directory
to easily find it when we install the Add-In.

2. Now open any Access database and go up to "Tools" on the main
Access menu bar. From there go down to the option called "Add-Ins".
This sub-menu will list any installed Access add-ins on your system, as
well as an option called "Add-In Manager". Click on the option called
"Add-In Manager" and a new screen will appear.

3. The box will display a list of available add-ins on the left side. Depending
upon where you unzipped the add-in file, you may see the John Viescas
Table Documentor already listed in this box. If the file is listed, click on the
option to highlight it and then press the "Install" button to complete the installation.
There should now be a little "x" next to the option meaning it has now been
installed. If you do not see the add-in listed in this box simply click the button
called "Add New..." where you can browse for the location of the file. Once
you find the file and click on it in the browse window, you will be taken back
to the Add-In Manager screen. Now you should see our add-in listed in the
box with a "x" by it meaning it has been successfully installed. If not, highlight
the option and then press the "Install" button to complete the installation. Hit the
"Close" button on the Add-In Manager when finished.
That's it, now we're ready to use the utility!

4. To launch the add-in, simply open any database you wish to document and go
up to Tools | Add-Ins and click on the new option "John Viescas Table Documentor".
Depending upon the number of tables in your database (and whether they are linked
or not), the utility should only take a few seconds to create the report and display it
on the screen. Once on screen you can either print the report or just view the different
pages. Doesn't get any easier than that!

Please post back to the newsgroup when you receive the files and if you have any
problems. The e-mail was being sent from a "dump" e-mail account and will not be
checked if a reply is sent. The ONLY way I will know if you received the file is
through the newsgroup.

Hope you find it useful.
 
I received it, thanks.
Dave
Jeff Conrad said:
Hi Dave,

Files have been sent to the address you provided.
Subject line will be:
"Access Add-In You Requested From The Newsgroup"
Follow these steps to install the Add-In and/or read the attached
Word document:

1. Unzip the file JVTableList.MDA to your Office or Access directory
to easily find it when we install the Add-In.

2. Now open any Access database and go up to "Tools" on the main
Access menu bar. From there go down to the option called "Add-Ins".
This sub-menu will list any installed Access add-ins on your system, as
well as an option called "Add-In Manager". Click on the option called
"Add-In Manager" and a new screen will appear.

3. The box will display a list of available add-ins on the left side.
Depending
upon where you unzipped the add-in file, you may see the John Viescas
Table Documentor already listed in this box. If the file is listed, click
on the
option to highlight it and then press the "Install" button to complete the
installation.
There should now be a little "x" next to the option meaning it has now
been
installed. If you do not see the add-in listed in this box simply click
the button
called "Add New..." where you can browse for the location of the file.
Once
you find the file and click on it in the browse window, you will be taken
back
to the Add-In Manager screen. Now you should see our add-in listed in the
box with a "x" by it meaning it has been successfully installed. If not,
highlight
the option and then press the "Install" button to complete the
installation. Hit the
"Close" button on the Add-In Manager when finished.
That's it, now we're ready to use the utility!

4. To launch the add-in, simply open any database you wish to document and
go
up to Tools | Add-Ins and click on the new option "John Viescas Table
Documentor".
Depending upon the number of tables in your database (and whether they are
linked
or not), the utility should only take a few seconds to create the report
and display it
on the screen. Once on screen you can either print the report or just view
the different
pages. Doesn't get any easier than that!

Please post back to the newsgroup when you receive the files and if you
have any
problems. The e-mail was being sent from a "dump" e-mail account and will
not be
checked if a reply is sent. The ONLY way I will know if you received the
file is
through the newsgroup.

Hope you find it useful.
 
I cannot get the mda file you sent opened. I know it has to do with
security settings, but it will not open.
 
What exactly do you mean by cannot "open" Dave?
Do you mean you cannot unzip the file or you
are trying to open the MDA file itself to run it?
The file is meant to be an Access add-in that
you install using the Add-In Manager utility.
Once installed you access it by going to Tools |Add-ins.

Are you using Windows XP by chance?

Can you provide a little more detail about exactly
you are doing and what is not working?
 
I am using Windows XP Pro.

Windows security will not allow me to take the MDA file out of the zip
folder. It has blocked access to the file. I even turn off the security
feature, but it still does not allow it.
Thanks,
Dave
 
Hi Dave,

Here is a past post by Rick Brandt which covers this issue:If he has Service Pack 2 for Windows XP installed it "Blocks" all
executable files that come from other systems whether that be Email or being
dragged from the network. You have to right-click on the file, view the
properties, and press the [Unblock] button in the lower right. Then the
file will work.
And here is a KB article on the subject as well:
http://support.microsoft.com/?id=883260

Once you have access to the file, then follow the installation
instructions I provided in the Word document.
 
Back
Top