Solved

describe table structure

Posted on 2001-06-27
8
2,582 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
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:smozgur
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:smozgur
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
 
LVL 11

Expert Comment

by:joekendall
ID: 6517401
zhoujingxiong:

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

Thanks!

Joe
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 17

Expert Comment

by:smozgur
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:smozgur
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now