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
Solved

describe table structure

Posted on 2001-06-27
8
2,682 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
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.

 
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

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.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server functions 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 Ac…
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.

856 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