Solved

describe table structure

Posted on 2001-06-27
8
2,720 Views
Last Modified: 2012-08-14


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.
0
Comment
Question by:zhoujingxiong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 4

Expert Comment

by:jsweby
ID: 6234158
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
 
LVL 17

Expert Comment

by:Suat Ozgur
ID: 6234195
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
 
LVL 17

Expert Comment

by:Suat Ozgur
ID: 6234220
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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 11

Expert Comment

by:joekendall
ID: 6517401
zhoujingxiong:

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

Thanks!

Joe
0
 
LVL 17

Expert Comment

by:Suat Ozgur
ID: 6517459
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
 

Accepted Solution

by:
amp072397 earned 0 total points
ID: 6742611
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
 
LVL 17

Expert Comment

by:Suat Ozgur
ID: 6742969
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
 

Expert Comment

by:amp072397
ID: 6743496
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question