Getting the fields names

  • Thread starter Thread starter Maracay
  • Start date Start date
M

Maracay

Hi guys

How can I know 1.- The number of columns in a table and 2.- The field names
of a query or table. I want to do a cycle until I have all the filed names.

Thanks
 
Hi,

Can I do this in a DAO database, I did your example and I got rst! plus the
field's name, not the value in the field, is there something missing.

Thanks
 
The code I posted for you uses DAO. The code DStegon posted for you uses
ADO. Both achieve exactly what you asked for, i.e.:
How can I know 1.- The number of columns in a table and
2.- The field names of a query or table.

If you also want to see the field values, you need to open a Recordset and,
for each record, cycle through the fields displaying its name and value.

For a table with a million records, this could produce a lot of pointless
output!
 
Back
Top