How to put recordset values into an array, first
1. Execute the sql
then 2. Loop through the recordset
inside the loop 3. ReDim the array with the preserve keyword
at last 4. Put RS in array item by item
Here is a code example:
sql = "select * from myTable"
Set RS = Conn.Execute(sql)
'Put the recordset in an array
Dim myArray()
numRows = 0
Do While NOT RS.EOF
numRows = numRows + 1
ReDim Preserve myArray(3, numRows)
myArray(0, numRows - 1) = RS(0)
myArray(1, numRows - 1) = RS(1)
myArray(2, numRows - 1) = RS(2)
myArray(3, numRows - 1) = RS(3)
RS.MoveNext
Loop
What you end up with is a 4 dimensional array (4 columns and a dynamic number of rows, depending on the number of records in the db).