populating a 2D array with recordset in asp-classic

danh1

New Member
I am attempting to fill a 2D array with items in a recordset, but I keep getting the following error:Microsoft VBScript runtime error '800a0009'Subscript out of range: 'UBound'I've also tried changing the UBound to Ubound(ProxState,1), but that just gives me the following error on the line following the start of the 'For' loop:Microsoft VBScript runtime error '800a0009'Subscript out of range\[code\]Dim ProxCount, LastProxProxCount = 0Do While Not objRS.EOF ProxCount = ProxCount + 1objRS.MoveNextLoopLastProx = ProxCount - 1objRS.MoveFirstDim ProxStateProxState = Array(LastProx,1)For i = 0 To UBound(ProxState,0) ProxState(i,0) = objRS("ProximityName") ProxState(i,1) = objRS("InState")Next\[/code\]
 
Top