How to list all the column names for a given table using a single query?

  • Thread starter Thread starter RaymondXie
  • Start date Start date
R

RaymondXie

Guest
:mad: :mad:
Hi folks,

I wonder how can I list all the column names for a given table using a single query? I know how to do it in SQL using system tables, but no idea how to do that in Access.

Thanks.
 
DAO recordset field names is what you what.

dim db as dao.database
dim rs as dao.recordset
dim ij as integer
set db=currentdb
set rs=db.openrecord("your SQL string",dbopensnapshot)
for ij= 1 to rs.fieldcount
debug.priint rs.fields(ij-1).name
next
db.close
rs.close
set db=nothing
set rs=nothing

'something like the foregoing will get you started
 

Users who are viewing this thread

Back
Top Bottom