I am pulling an ADO recordset in VB code. the fields in this recordset are "OrderID", and "Industry"

I am reading these items into an array for processing . Orders next to each other in the array cannot have the same industry if at all possible. I need a way to split them up and guarantee that if I have a situation like 7 orders with three of those belonging to the same industry that they don't end up next to each other.

Any ideas would be helpful