I am new to functions and arrays, and my brain is now officially jello... runny too long in the sun jello...

I need to dynamically create an array, sort of...

Here is the method that i am using for static content:

Code:
Function GetItemParameters(iItemID)
Dim aParameters
  Select Case iItemID
    Case 1 
      aParameters = Array("ItemID", "CategoryID", "15.00")
   Case 2
      aParameters = Array("ItemID", "CategoryID", "17.50")
   Case 3
     aParameters = Array("ItemID", "CategoryID", "35.00")
  End Select
GetItemParameters = aParameters
End Function
However, I need to populate it from a database. This is for a shopping cart, and there is no way that i'm going to be able to list the items manually, because it can change dynamically. I can't find any tutorials to show me how to do that.

I can count the Item records for each Category (relational tables), however, i can't for the life of me figure out how to generate this case select statement dynamically.

this is the best that i've come up w/ and of course, it doesn't work:

Code:
Function GetItemParameters(iItemID)
  i=0
  j=CInt(objItemsRS.RecordCount-1)
  
  Select Case iItemID
  for i=i to j
  Case CInt(i)
   aParameters(i) = Array(objItemsRS("ItemID"),objItemsRS("CatID"), &_
objItemsRS("ItemHeader"),objItemsRS("ItemSubHeader"), &_
objItemsRS("ItemPrice"),objItemsRS("ItemSalePrice"), &_
objItemsRS("ItemImg"),objItemsRS("ItemSKU"))
  Next
  End Select
GetItemParameters = aParameters
End Function
can anyone help?