Use ADO (ActiveX Data Objects) and SQL to return the results of the query to a recordset.
Then loop through the records in the recordset doing whatever you need to do. An array isn't required for this.