Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field Names 2

Status
Not open for further replies.

PythonGuy

Programmer
Feb 2, 2004
1
US
How can I get the field names from my Access table? A metadata table name would be what I really need, I'm righting a script using python that will need to read the column names. Thanks
 
I think the Tools/Analyzer/Documenter menu option can create a table for you with the metadata on tables you select. If you want to get the information dynamically, you should use VBA to read through the Fields collection of a TableDef object and puts the results into a table for you. There are examples in earlier posts about extracting metadata with VBA.
 
As JonFer suggested, use the Documenter. You can also create a link to the resulting table which on my PC is:
DATABASE=C:\Documents and Settings\Duane Hookom\Application Data\Microsoft\Access\ACWZUSRT.MDT;TABLE=doc_tblObjects
Once you have linked to doc_tblObjects in ACWZUSRT.MDT, you can create your own queries like:
[blue]
Code:
SELECT doc_tblObjects.Name AS TableName, doc_tblObjects_1.Name AS FieldName, doc_tblObjects_1.Extra2 AS FieldType, doc_tblObjects_1.Extra3 AS FieldSize
FROM doc_tblObjects AS doc_tblObjects_1 INNER JOIN doc_tblObjects ON doc_tblObjects_1.ParentID=doc_tblObjects.ID
WHERE (((doc_tblObjects_1.TypeID)=11));
[/blue]

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top