'Creates a list from a resultset
'stringargs(): if Query has Question Marks pass array of parameters, otherwise pass null
'Limit: total number of rows to take from DB, pass 0 to all
Public Sub ExecuteMemoryTable(Query As String, StringArgs() As String, Limit As Int) As List
Dim cur As ResultSet
If StringArgs = Null Then
Dim StringArgs(0) As String
End If
cur = SQL1.ExecQuery2(Query, StringArgs)
Dim table As List
table.Initialize
Do While cur.NextRow
Dim values(cur.ColumnCount) As String
For col = 0 To cur.ColumnCount - 1
values(col) = cur.GetString2(col)
Next
table.Add(values)
If Limit > 0 And table.Size >= Limit Then Exit
Loop
cur.Close
Return table
End Sub