Solved

describe table structure

Posted on 2001-06-27
8
2,649 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: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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
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…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

803 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