1. Junior Member
Join Date
Dec 1969
Posts
4

## Adding Dimensions to GetRows Array

I was wandering if it was possible to add 2 dimensions onto the 2 dimensional array of getrows, or is there a way to combine or loop two getRows arrays at the same time in order to match one array ontop of the other.<BR><BR>Thanks a bunch~!

2. Senior Member
Join Date
Dec 1969
Posts
96,118

## Given the nature of what...

...you were working with before, I think you&#039;d be better off with two separate arrays. I don&#039;t see a reason to combine them into one.<BR><BR>If you added two dimensions to a 2D array, you&#039;d have a 4D array. I don&#039;t know many humans who can get their minds around such an animal.<BR><BR>I suspect you mean only that you wanted to add two *columns* to the array, no?<BR><BR>In that case it&#039;s easy: Add them in the SQL statement!<BR><BR>SELECT 0 As dummy1, 0 As dummy2, field1, field2, ... FROM table ...<BR><BR>And now, when you turn the recordset you get from that into a 2D array, you will have:<BR><BR>CONST C_dummy1 = 0<BR>CONST C_dummy2 = 1<BR>CONST C_field1 = 2<BR>etc.<BR><BR>On the other hand, if you meant to ask how to add two *rows* to such an array, that&#039;s even easier:<BR><BR>data = RS.GetRows<BR>ReDim Preserve data( UBound(data,1), UBound(data,2)+2 )<BR><BR>That will add the two rows at the end.<BR><BR>But despite all the above, I suspect that for what you are doing the right answer is to simply have two completely separate arrays.<BR><BR>

3. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## Here's code to combine..

.. two 2D arrays..<BR><BR>http://www.27seconds.com/kb/article_view.asp?id=17

#### Posting Permissions

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