Solved

Assigning a Split Array to an ASP Multidimensional Dynamic Array

Posted on 2008-10-10
1
621 Views
Last Modified: 2012-05-05
Hi,

I have a recordset with a single column, where each cell contains a number of tilda separated values, for example:
| one~two~three |
| four~five~six |

which I want set up into a two dimensional array, ie:
| one | two | three |
| four | five | six |

I keep getting 'Subscript out of range: 'arrArray'' error, and I assume I am doing something fundamentally wrong - can anyone help out please?

Thanks in advance!
~ Bob
If Not(objRefCursor.eof) And Not(objRefCursor.bof) Then
		
    ReDim arrArray(objRefCursor.RecordCount, nColumns)
		
    For nRowCount = 0 To nRows
        arrArray(nRowCount) = Split(objRefCursor(nRowCount), "~")
    Next
			
  End If

Open in new window

0
Comment
Question by:FrostbiteXIII
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
FrostbiteXIII earned 0 total points
ID: 22685754
Looks like I just missed the second index from my arrArray line... Bah...

This seems to (roughly) work, for anyone else needing it.
If Not(objRefCursor.eof) And Not(objRefCursor.bof) Then
                
    ReDim arrArray(objRefCursor.RecordCount, nColumns)
                
    For nRowCount = 0 To nRows
        arrArray(nRowCount, 0) = Split(objRefCursor(nRowCount), "~")
    Next
                        
End If

Open in new window

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question