Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: i want to iterate through the fields in my table


Message #1 by "taherm@f... on Mon, 26 Nov 2001 17:41:13
instead of iterating thorugh the rows by using 

do while not rsTable1.eof

instead

i want to list my fields in my table1.

eg  table1 has following 2 fields

itemcode

price





i want to count the number of fields in my db and display them on my asp 

page





plz let me knw of how can i achieve the above...



Thanks a million

any suggesstions will be much appreciated
Message #2 by Kyle Burns <kburns@c...> on Mon, 26 Nov 2001 13:03:54 -0500
Take a look at the ADODB Field object and the Fields collection of the ADODB

Recordset object.  This should give you what you need.



=================================

Kyle M. Burns, MCSD, MCT

ECommerce Technology Manager

Centra Credit Union

kburns@c...



 



-----Original Message-----

From: taherm@f...

[mailto:taherm@f...]

Sent: Monday, November 26, 2001 12:41 PM

To: ASP Web HowTo

Subject: [asp_web_howto] i want to iterate through the fields in my

table





instead of iterating thorugh the rows by using 

do while not rsTable1.eof

instead

i want to list my fields in my table1.

eg  table1 has following 2 fields

itemcode

price





i want to count the number of fields in my db and display them on my asp 

page





plz let me knw of how can i achieve the above...



Thanks a million

any suggesstions will be much appreciated




$subst('Email.Unsub')

Message #3 by riley@i... on Mon, 26 Nov 2001 20:48:09
for a=0 to rsTable.fields.count



  response.write  "Field Name= " & rsTable.fields(a).name & "<BR>"



next



response.write "Total number of fields= " & rsTable.fields.count







hope this helps.

> instead of iterating thorugh the rows by using 

> do while not rsTable1.eof

> instead

> i want to list my fields in my table1.

> eg  table1 has following 2 fields

> itemcode

> price

> 

> 

> i want to count the number of fields in my db and display them on my asp 

> page

> 

> 

> plz let me knw of how can i achieve the above...

> 

> Thanks a million

> any suggesstions will be much appreciated
Message #4 by Kyle Burns <kburns@c...> on Tue, 27 Nov 2001 08:56:35 -0500
Another option is to use For Each...Next syntax.  I prefer this to the array

method:



Dim fld

For Each fld In rsTable.Fields

	Response.Write "Field Name: " & fld.Name

Next 'fld



=================================

Kyle M. Burns, MCSD, MCT

ECommerce Technology Manager

Centra Credit Union

kburns@c...



 



-----Original Message-----

From: riley@i... [mailto:riley@i...]

Sent: Monday, November 26, 2001 3:48 PM

To: ASP Web HowTo

Subject: [asp_web_howto] Re: i want to iterate through the fields in my

table





for a=0 to rsTable.fields.count



  response.write  "Field Name= " & rsTable.fields(a).name & "<BR>"



next



response.write "Total number of fields= " & rsTable.fields.count







hope this helps.

> instead of iterating thorugh the rows by using 

> do while not rsTable1.eof

> instead

> i want to list my fields in my table1.

> eg  table1 has following 2 fields

> itemcode

> price

> 

> 

> i want to count the number of fields in my db and display them on my asp 

> page

> 

> 

> plz let me knw of how can i achieve the above...

> 

> Thanks a million

> any suggesstions will be much appreciated




$subst('Email.Unsub')


  Return to Index