If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Only **FIRST** item of array being returned

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-26-04, 06:03
axapta axapta is offline
Registered User
 
Join Date: Apr 2004
Posts: 47
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
Reply With Quote
  #2 (permalink)  
Old 04-26-04, 13:48
ASP-Hosting.ca ASP-Hosting.ca is offline
Registered User
 
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.
Reply With Quote
  #3 (permalink)  
Old 04-28-04, 02:01
MrWizard MrWizard is offline
Registered User
 
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
__________________
Tim

Last edited by MrWizard; 04-28-04 at 02:05.
Reply With Quote
  #4 (permalink)  
Old 04-28-04, 03:01
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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?
Reply With Quote
  #5 (permalink)  
Old 04-28-04, 09:57
ASP-Hosting.ca ASP-Hosting.ca is offline
Registered User
 
Join Date: Apr 2004
Posts: 50
Quote:
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)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On