Solved

Assigning a Split Array to an ASP Multidimensional Dynamic Array

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now