Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Posts
    47

    Unanswered: Only **FIRST** item of array being returned

    Hi Group,
    I'm hoping someone will be able to help.

    I am using the following code to output an array of data. However for every row and column, the FIRST item in the arrayed is being output.
    I've debugged and inspected the irows and icols variables, and these are correct.

    Set rst = objConn.Execute(SQL)
    If Not rst.EOF Then

    arrData = rst.GetRows()
    rst.Close
    set rst=nothing

    irows = UBound( arrData, 2 )
    icols = UBound( arrData, 1 )

    redim flippedResults(irows,icols)
    for i = 0 to irows
    for j = 0 to icols
    flippedResults(i,j) = arrData (j,i)
    next
    next

  2. #2
    Join Date
    Apr 2004
    Posts
    50
    I guess you are trying to print the values in flippedResults? You can try and print the arrData first and see what happens.

  3. #3
    Join Date
    Mar 2003
    Location
    Atlanta, GA
    Posts
    191
    You showed the code for building your array, but not any of the code for your output.

    Since you're asking for help with the output, why not post your code for the output? Perhaps that's where the problem is.

    Tim
    Last edited by MrWizard; 04-28-04 at 03:05.
    Tim

  4. #4
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    this might be your problem here....

    redim flippedResults(irows,icols)

    from memory you can only redim the last dimension in a multi dimension array...

    So you icols redim works but not your iRows....

    As another question.... why flip the array?

  5. #5
    Join Date
    Apr 2004
    Posts
    50
    from memory you can only redim the last dimension in a multi dimension array...
    That is correct, you can only redim the last dimension of the array.Instead of redim use the following:

    Dim flippedResults(irows,icols)

Posting Permissions

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