Results 1 to 2 of 2

Thread: GetRows

  1. #1
    Join Date
    Dec 1969

    Default GetRows

    Something seems to be wrong with the way I&#039;m carrying out my getRows function. I do a ...<BR><BR>Dim yrArray<BR>...<BR>yrArray = objRS.GetRows(,,Array("Years"))<BR>...<BR>Response .Write yrArray(3) & "<BR>"<BR><BR>Something to that effect, but get a <BR><BR>Subscript out of range <BR><BR>error message when trying to print any elements. Can someone please help me?? Thanks so much!!

  2. #2
    Join Date
    Dec 1969

    Default GetRows gives *2D* array!

    You have to reference the elements of that 2D array via:<BR><BR>&#060;%<BR>Response.Write yrArray( columnNumber, rowNumber )<BR>%&#062;<BR><BR>Even though you specified only a single field to be returned by GetRows (with your Array("Years") argument), it *still* will return a 2D array. Just that the columnNumber will then always have to be zero:<BR><BR>&#060;%<BR>Response.Write yrArray( 0, rowNumber )<BR>%&#062;<BR><BR>Incidentally, to find the maximum row number, you must *always* do:<BR><BR>&#060;%<BR>maxRow = UBound( yrArray, 2 ) &#039; note the 2 as second argument!<BR>%&#062;<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