Array and Recordset

Results 1 to 2 of 2

Thread: Array and Recordset

  1. #1
    Join Date
    Dec 1969

    Default Array and Recordset

    I am following instructions on ASP faq article about putting a recordset in an array....<BR><BR>I did this<BR>aTable1Values = DD_RS.GetRows()<BR><BR>I know how to display all the records on the array by doing this..<BR><BR>For BS_Rowloop = 0 to UBound(aTable1Values, 2)<BR>For BS_ColLoop = 0 to UBound(aTable1Values, 1)<BR><BR>My question is the recordset contains two fields, how can I print(response.write) the second field from the array explicitly?<BR><BR>Thanks!<BR>

  2. #2
    Join Date
    Dec 1969

    Default Just one step further....

    If you looked at what happens next in that code, you&#039;d have gotten it:<BR><BR>aTable1Values = DD_RS.GetRows()<BR><BR>For BS_Rowloop = 0 to UBound(aTable1Values, 2)<BR>&nbsp; &nbsp; For BS_ColLoop = 0 to UBound(aTable1Values, 1)<BR>&nbsp; &nbsp; &nbsp; &nbsp; Response.Write aTable1Values( BS_ColLoop, BS_Rowloop )<BR>...<BR><BR>In other words, you specify a specifc "cell" in the array by using<BR>&nbsp; &nbsp; arrayName( columnNumber, rowNumber )<BR><BR>Remembering that columns and rows *ALWAYS* are numbered starting at 1, to get the 2nd field you would use<BR><BR>&nbsp; &nbsp; arrayName( 1, rowNumber )<BR><BR>That&#039;s all there is to it. Don&#039;t make it hard; it isn&#039;t.<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts