By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

retrieve column names of a table using SQL

P: 1
SQL newbie here so appreciate your patience and help

Windows XP Home, Microsoft Access 2002, ActivePerl 820 (corresponds to Perl version 5.8.8), Abyss Web Server X1 (v 2.4)

An archived post on the same subject proposed the following solution:

"SELECT * INTO [TEXT;HDR=Yes;DATABASE=F:\Work\Test\].MyTable.txt
FROM MyTable WHERE (1 = 0);

HTH.
Gunny"

Ths worked great in posting the field names to a text file, by I am passing queries from Perl and would like the field names returned as a string or array. I suppose I could read the created text file but was hoping there might be a more elegant SQL solution similar to passing a count of records and using the AS operator

Parsing the recordset doesn't work becuase that only contains the field values not names.

TIA

dan
Sep 11 '07 #1
Share this Question
Share on Google+
1 Reply


Scott Price
Expert 100+
P: 1,384
This thread contains some code by ADezii that does just this through a recordset...

How To Export Table Structure Including Description

Regards,
Scott
Sep 19 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.