Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 <Use the search I can't, ask the gurus I must>

Author  Topic 

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2004-09-13 : 08:18:48
I know I read something about it here somewhere but I can't fint where: is it possible to have the column-names be a part of the results in a sql-query? Or any other way I can display column names dynamically in my asp?

--
Lumbago
"Real programmers don't document, if it was hard to write it should be hard to understand"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-09-13 : 08:22:59
Any recordset object will have a Fields collection that will give you the names:

rs.Open "SELECT * FROM myTable", myConn
for each fld in rs.Fields
response.write fld.Name & "<br>"
next
rs.Close
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2004-09-13 : 08:24:26
Hm, cool...thanx!

--
Lumbago
"Real programmers don't document, if it was hard to write it should be hard to understand"
Go to Top of Page
   

- Advertisement -