VB Code:
  1. Function FetchArray(strQuery As String, conn As ADODB.Connection) As Variant
  2. Dim resBuff() As Variant
  3. Dim nRS As ADODB.Recordset
  4. Dim fld As ADODB.Field
  5.  
  6. Dim iRow As Integer, iField As Integer
  7.  
  8. Set nRS = New ADODB.Recordset
  9. nRS.CursorLocation = adUseServer
  10.  
  11. nRS.Open strQuery, conn
  12. nRS.MoveFirst
  13.  
  14. iRow = -1
  15. iField = -1
  16.  
  17. Do Until nRS.EOF
  18.     iRow = iRow + 1
  19.     For Each fld In nRS.Fields
  20.         iField = iField + 1
  21. [b]        resBuff(iRow, iField) = fld.Value[/b]
  22.         Debug.Print resBuff(iRow, iField)
  23.     Next
  24. Loop
  25. End Function

It seems to have trouble on ^ that line.

I tried resBuff(iRow)(iField) = fld.Value but I can't even remember how to do 2d arrays in vb now.

I was hoping to re create some of the PHP->mysql functions in vb because i hate recordsets

The idea of the above is to load a query into an array.

Any ideas?