473,385 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

table information

hi there,

I am just wondering if there is a way to get a complete list of all
the field properties for a table within your database; aside from
clicking on each field and writing all the properties down.

thanks
Nov 13 '05 #1
9 1253
Chanchito wrote:
hi there,

I am just wondering if there is a way to get a complete list of all
the field properties for a table within your database; aside from
clicking on each field and writing all the properties down.

thanks


Tools - Analyze - Table

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2
"Chanchito" <my**********@gmail.com> wrote in message
news:4f*************************@posting.google.co m...
hi there,

I am just wondering if there is a way to get a complete list of all
the field properties for a table within your database; aside from
clicking on each field and writing all the properties down.

thanks


Try this code on for size:
'---<< begin code >>---
Public Sub tablesProperties()
On Error Resume Next

Dim x As Long, y As Long, z As Long

For y = 0 To CurrentDb.TableDefs.Count - 1
Debug.Print "Properties for table "; CurrentDb.TableDefs(y).Name;
":"
For x = 0 To CurrentDb.TableDefs(y).Fields.Count - 1
Debug.Print " Field: "; CurrentDb.TableDefs(y).Fields(x).Name
For z = 0 To CurrentDb.TableDefs(y).Fields(x).Properties.Count -
1
Debug.Print " ";
CurrentDb.TableDefs(y).Fields(x).Properties(z).Nam e; ": ";
Debug.Print
CurrentDb.TableDefs(y).Fields(x).Properties(z).Val ue;
If Err.Number Then Err.Clear: Debug.Print "(n/a)";
Debug.Print
Next z
Next x
Debug.Print
Next y

End Sub

'----<< end code >>----
Nov 13 '05 #3
thanks for the direction...it ended up being the Documenter in the
Analyze menu that gave me what I want, but thanks again as I didn't
even realize that menu was there. cheers

Nov 13 '05 #4
pardon my ignorance, but when I pasted the code into a new module VB
showed a bunch of stuff highlighted in read and when I tried to run the
code it brought up a box saying compile error syntax error and
highlighted the first instance of read indicating the ":" portion
between the two For statements.

I have also tried the Tools - analyze - documenter, and that does show
most of what I want, but it doesn't show the default values of the
field, any input masks, or things of that nature.

Nov 13 '05 #5
"chanchito" <my**********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
pardon my ignorance, but when I pasted the code into a new module VB
showed a bunch of stuff highlighted in read and when I tried to run the
code it brought up a box saying compile error syntax error and
highlighted the first instance of read indicating the ":" portion
between the two For statements.

I have also tried the Tools - analyze - documenter, and that does show
most of what I want, but it doesn't show the default values of the
field, any input masks, or things of that nature.

That's because of thw unfortunate word-wrapping in the newsgroup post. You
will have to move the ":" to the end of the previous line.
Nov 13 '05 #6
thanks, i got the code to look right (i.e- no red lines showing up
anywhere), but is there stuff that i should be creating on my end of
things for this data to go into? When I run the code the hourglass
shows that something is running, but there is no output. Nothing
prints.

once again, I apologize for my lack of access knowledge. =(

Nov 13 '05 #7
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It should appear in the Debug window (Ctrl-G). If you have a lot of
tables, some of the info will "disappear," since the Debug window can't
hold a lot of data. In that case you may wish to redirect the output to
a text file.

Here is another version of the same code, but using the For Each...Next
syntax, which is easier to read.

Public Sub tablesProperties()
On Error Resume Next

Dim t As dao.TableDef, f As dao.field, p As dao.Property

For Each t In CurrentDb.TableDefs
Debug.Print "Properties for table "; t.Name; ":"
For Each f In t.Fields
Debug.Print " Field: "; f.Name
For Each p In f.Properties
Debug.Print " "; p.Name; ": ";
Debug.Print p.value;
If Err.Number Then Err.Clear: Debug.Print "(n/a)";
Debug.Print
Next p
Next f
Debug.Print
Next t

End Sub

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQj44jIechKqOuFEgEQKkbgCcC+U6VBrUXuXuQYYiahRcgZ +eA6oAoPD2
LGEQStWQU4uyovBHl05vEWeB
=QT0p
-----END PGP SIGNATURE-----
chanchito wrote:
thanks, i got the code to look right (i.e- no red lines showing up
anywhere), but is there stuff that i should be creating on my end of
things for this data to go into? When I run the code the hourglass
shows that something is running, but there is no output. Nothing
prints.

Nov 13 '05 #8
i had forgotten about the debug window, the first code you gave me does
work, but like you said it doesn't show all the fields or all the
tables, so I guess I will have to have it output to a text file. I
would just add this onto the print statement right?

thanks for your help.

Nov 13 '05 #9
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You'll have to define the file descriptor first. E.g.:

dim fd as integer

fd = freefile
Open "table info.txt" for output as #fd
print #fd, ' <- use this in place of the Debug.Print
.... etc. ...
' when done printing
close #fd

Substitute you're own file name.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQj+KBYechKqOuFEgEQIkXQCePuZI7KbNqIwCqWK+6s9SMO VkiNkAn3qk
+luqoC9YlKx10xHoSbJqjOP6
=Azc3
-----END PGP SIGNATURE-----
chanchito wrote:
i had forgotten about the debug window, the first code you gave me does
work, but like you said it doesn't show all the fields or all the
tables, so I guess I will have to have it output to a text file. I
would just add this onto the print statement right?

Nov 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
8
by: Jean-Marc Blaise | last post by:
Dear all, It seems there is a problem with some snapshot table functions, if you try to divide by some element that is unset or equal to 0. This generates a trap file with the db2fmp.exe...
5
by: Sami | last post by:
Please bear with me, and if you answer this question, please do it step by step. I am new at Access, not at all sophisticated. I am using Office XP. This will need to be read in Access for...
6
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID ...
0
bilibytes
by: bilibytes | last post by:
hi, I was wondering how to determine whether an information is redundant or not. if you have in a table "Main", the basic information for a thing: thing_id | name | image_id | city_id ok if...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.