I use this code to fill array:
Erase strDBRows()
strDBRows = RS1.GetRows(RS1.RecordCount)
in the recordset are 7 column.
Now i need to traspose the column 4 of array in a new array, similar:
NewArray('12345','457','589',...'4578')
i need to loop all items in the column 4 and create a string, or exists a function similar application.transpose (strDBRow, 4?)
TRANSPOSE column of array
-
- Administrator
- Posts: 78481
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: TRANSPOSE column of array
Code: Select all
Dim I As Long
Dim N As Long
...
N = RS1.RecordCount
Erase strDBRows()
strDBRows = RS1.GetRows(N)
ReDim NewArray(N - 1) As String
For I = 0 To N - 1
NewArray(I) = strDBRows(3, I)
Next I
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
Re: TRANSPOSE column of array
Ok in this case if i have understand non possibile in one shot only?HansV wrote:Code: Select all
Dim I As Long Dim N As Long ... N = RS1.RecordCount Erase strDBRows() strDBRows = RS1.GetRows(N) ReDim NewArray(N - 1) As String For I = 0 To N - 1 NewArray(I) = strDBRows(3, I) Next I
I need strictlly to loop to create the transpostion of arry?
-
- Administrator
- Posts: 78481
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands