Private Sub InsertRDCRecords(TableName As String, Res As DBResult)
' Get Field Names --------------------------------------------------
Dim colArray(100) As String ' why do I have to put 100
Dim iCol As Int = -1
For Each col In Res.Columns.Keys
iCol = iCol + 1
colArray(iCol) = col
Log("col = " & colArray(iCol))
Next
' Insert Records --------------------------------------------------
Dim iList As List
For Each row() As Object In Res.Rows
iList.Initialize
Dim m As Map
m.Initialize
Dim iRow As Int = -1
For Each record As Object In row
iRow = iRow + 1
Log(colArray(iRow) & " = " & record)
m.Put(colArray(iRow),record)
Next
iList.Add(m)
DBUtils.InsertMaps(Main.SQL1,TableName,iList)
Next
End Sub