Array GetRows() problem

Results 1 to 2 of 2

Thread: Array GetRows() problem

  1. #1
    Join Date
    Dec 1969

    Default Array GetRows() problem

    If I take out Cat_name and remove i3 then the script works fine. With i3 left in I get "Subscript out of range: &#039;UBound&#039;"<BR><BR>Any help would be greatly appreciated :)<BR><BR> SQL = "SELECT * "<BR> SQL = SQL & " FROM Cat_tbl "<BR> SQL = SQL & " WHERE Cat_PID = 0"<BR> Response.Write(SQL)<BR> set RS_Cats = Server.CreateObject("ADODB.Recordset")<BR> RS_Cats.Open SQL, Conn, adOpenKeyset, adLockOptimistic<BR> <BR> CatArray = RS_Cats.GetRows(,, Array("Cat_ID", "Cat_PID", "Cat_Name"))<BR><BR> For i3 = 0 to UBound(CatArray, 3)<BR> For i2 = 0 to UBound(CatArray, 2)<BR> For i1 = 0 to UBound(CatArray, 1)<BR> Response.Write(CatArray(i1, i2, i3))<BR> Next &#039;i1<BR> Response.Write("&#060;hr&#062;")<BR> Next &#039;i2<BR> Next &#039;i3

  2. #2
    Join Date
    Dec 1969

    Default GetRows() returns a two-dimensional...

    ...array - columns by rows (or the other way round - can&#039;t remember). So, if you want to get a third dimension, it won&#039;t work. You can only do CatArray(column_index, row_index) (or the other way round - really can&#039;t remember). What did you think the third dimension would be?<BR><BR>Oliver.

Posting Permissions

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