Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return # of Fields in sql query 1

Status
Not open for further replies.

AgentM

MIS
Jun 6, 2001
387
US
Is there a way to retrieve the number of fields in a sql query or the table fields from a sql query
 
Sure, if all you need is the number of fields you can just use:


objRS.Fields.Count


for other information you could loop through and get the information. Here is a small example:


For Each Field In ObjRS.Fields
Response.Write Field.Name & &quot;<br>&quot;
Next


This will give you the name of each field in the recordset. Hope this helps.....:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top