Skip to content

Instantly share code, notes, and snippets.

@marcelodeandrade
Created September 21, 2017 19:00
Show Gist options
  • Save marcelodeandrade/c8dffb2ae89dee6781ef69b47e759fd8 to your computer and use it in GitHub Desktop.
Save marcelodeandrade/c8dffb2ae89dee6781ef69b47e759fd8 to your computer and use it in GitHub Desktop.
Get a recordset and use getRows
Function GetRSArray(strSQL)
Set objRS = Conn.Execute(strSQL)
If Not objRS.EOF Then arrRS = objRS.GetRows()
Set objRS = Nothing
GetRSArray = arrRS
End Function
arrRS = GetRSArray("SELECT ID, Name FROM users;")
If IsArray(arrRS) Then
For i = LBound(arrRS, 2) To UBound(arrRS, 2)
ID = arrRS(0, i)
Name = arrRS(1, i)
Response.Write("<p>" & Name & " (" & ID & ")</p>" & vbCrLf)
Next
Erase arrRS
End If
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment