Query to return field names from table

  • Thread starter Thread starter BlueWolverine
  • Start date Start date
B

BlueWolverine

Hello,
MS ACCESS 2003 on XP PRO.

I want to write a query that will return the field names from a table/query.

I found

<<<
SHOW COLUMNS FROM 'TABLE';
on a MYSQL google search but this does not work in Access.

How can I do this in Access?
Thanks.
 
You can try the following untested query

SQL to List FieldNames for a query. Doesn't work for a table.

SELECT MSysQueries.Expression
FROM MSysObjects INNER JOIN MSysQueries ON MSysObjects.Id =
MSysQueries.ObjectId
WHERE (((MSysObjects.Name)="qryCustDetails") AND
((MSysQueries.Expression)<>""));

For a table, you can either construct a query and save it or use a
custom VBA function.
'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
Back
Top