describe table structure



Does anybody know a tools or SQL syntax that can desribe table structure of Ms Access database ?
I want the same result that produce by Oracle syntax :
desc tablename;

desc tableA;

result :

aaaa  char(5);
bbbb  integer;

but this time, I used MS Access .mdb

I need this for the software documentation

Thanks for your help.
zhoujingxiongAsked:
Who is Participating?
 
amp072397Commented:
z---'s last login was December. Points will be awarded to smozgur if Z does not return with a viable objection.

thanks!
amp
community support moderator
0
 
jswebyCommented:
Access has a table analyser, is that any good? Go to Tools | Analyse | Table to get a documented field and index structure of your table(s).

J.
0
 
Suat OzgurWeb / Application DeveloperCommented:
Private Sub DescTable(tblName As String)

Set db = CurrentDb
For i = 0 To db.tabledefs(tblName).Fields.Count - 1
    Debug.Print db.tabledefs(tblName).Fields(i).Properties(4).Value & "-" & db.tabledefs(tblName).Fields(i).Properties(3).Value
Next i
End Sub

You can call this sub like this for tableA:

Call DescTable("tableA")

results would be written into immediate window like you described above.

field1name : field1Type(numeric)
field2name : field2Type(numeric)
...
fieldnname : fieldnType(numeric)

You can assign strings for types and display strings instead of numeric values.


suat
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Suat OzgurWeb / Application DeveloperCommented:
You can also get the Descriptions for fields by using Property index 23:

db.tabledefs(0).fields(0).properties(23).value

gives description for related field. But you should be careful because it will cause an error if description is empty. So you can use error handler for empty descriptions.

suat
0
 
joekendallCommented:
zhoujingxiong:

Was smozqur's answer sufficient? If not, please post again.

Thanks!

Joe
0
 
Suat OzgurWeb / Application DeveloperCommented:
Member Name zhoujingxiong
Questions Asked 2
Last 10 Grades Given B  
Question Grading Record 1 Answers Graded / 1 Answers Received

I completely forgot this question since i saw this profile.

suat
0
 
Suat OzgurWeb / Application DeveloperCommented:
Hi amp,

I think z... thinks that s/he wouldnot need EE anymore. But i will remember his nick for his possible next questions.

regards
suat
0
 
amp072397Commented:
smozgur:

You deserved the points, here they are:

http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=msaccess&qid=20257153

and thanks!
amp
community support moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.