Thread: Get Field Names
View Single Post
  #1 (permalink)  
Old February 24th, 2006, 09:27 PM
fizzerchris fizzerchris is offline
Authorized User
Points: 229, Level: 4
Points: 229, Level: 4 Points: 229, Level: 4 Points: 229, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2005
Location: , , .
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default Get Field Names

Is there a way to get all field names in a table without returning an entire recordset?  This works, but it returns everything which is probably unneccessary:
<%
Dim sSQL
Dim Field
Dim oRS
sSQL = "SELECT * FROM table"
Set oRS=Server.CreateObject("ADODB.RecordSet")
oRS.Open sSQL, "DSN=dbname"

For Each Field in oRS.Fields
  Response.Write Field.Name
Next
%>
Reply With Quote