Solved

Assigning a Split Array to an ASP Multidimensional Dynamic Array

Posted on 2008-10-10
1
619 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
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

776 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