title: Classic ASP 3.0 Create Array from a Recordset
body: <p>I'm trying to fix an ASP Classic app and when I try to create an array from a Recordset Object.  However I Can't get it to work correctly.</p>
  
  <p>This code gives me a single record (the last one), but as far as I can see it is correct:</p>
  
  <pre><code>Dim Products
  Dim Products_cmd
  Dim Products_numRows
  
  Set Products_cmd = Server.CreateObject ("ADODB.Command")
  Products_cmd.ActiveConnection = Conn
  Products_cmd.CommandText = "SELECT prod_id, prod_description FROM dbo.products ORDER BY prod_description ASC" 
  Products_cmd.Prepared = true
  
  Set Products = Products_cmd.Execute
  Products_numRows = 0
  
  Dim arrProducts()
  arrProducts = Products.GetRows()
  </code></pre>
  
  <p>Using this code gives me an "Subscript out of range: 'UBound'</p>
  
  <pre><code>Dim Products
  Dim Products_cmd
  Dim Products_numRows
  
  Set Products_cmd = Server.CreateObject ("ADODB.Command")
  Products_cmd.ActiveConnection = Conn
  Products_cmd.CommandText = "SELECT prod_id, prod_description FROM dbo.products ORDER BY prod_description ASC" 
  Products_cmd.Prepared = true
  
  Set Products = Products_cmd.Execute
  Products_numRows = 0
  Dim arrProducts()
  Dim counter
  
  For counter = 0 to Products.RecordCount - 1
      ReDim Preserve arrProducts(counter,2)
      arrProducts(counter,0) = Products.Fields.Item("prod_id").Value
      arrProducts(counter,1) = Products.Fields.Item("prod_description").Value
      Products.MoveNext
  Next
  Response.Write(Str(UBound(arrProducts)))
  </code></pre>
  
  <p>Any ideas would be GREATLY appreciated...</p>