[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 467
  • Last Modified:

Trying to determine table columns

What is the query syntax for determining a table's column names in MS Access (I'm using 2003 if it matters)?

I have all the "system" tables (i.e. MSysObjects), but I can't figure how to query for a specified table's columns...

Thanks in advance,
  • 2
1 Solution
pillbug22Author Commented:
Now I'm thinking the column names may be hidden in the LVProp column of the MSysObjects table for each table...

If I'm headed in the right direction, any clues on iterating through that coulmn (Long Binary Data) to get the table's columns? My first thought is that I'd need some VBA code and can't do it just from a query...
Guy Hengel [angelIII / a3]Billing EngineerCommented:
run this query for the table you are looking for the columns:
select * from yourtable where 1=0

this will return an empty recordset (no rows), but the fields collection is defined, simply loop the fields collection of the recordset
pillbug22Author Commented:
See? It's alwasy the over-obvious simple things that rack your brain after staring at the screen for too long...

Thanks for the kick in the pants!

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now