When columnNames is nonzero, the first row of the array will be set to the column names as specified by the database schema.
This is a simple answer and clear when you use ADODB.Recordset instead.
'Give me the value of the column
To Navigate around:
MoveFirst : Move to the first record in the recordset
MoveNext : Move to the next record in the recordset
MoveLast : Move to the last record in the recordsset
Move : Moves the position of the current record
BOF : Indicates that the current record position is before the
EOF : Indicates that the current record position is after the last
RecordCount: Indicates the current number of records
As a background to ADODB.Recordset the following function will return the recordset, you need the sql and connection string like the sql functions available using Robot. The cursor and lock types are key and one should know what they do when starting to implement ADODB, lots of info on the net:
Dim oRs as Object
Set oRs = GetRecordset(sSQL, sConnectString)
Function GetRecordset(psSQL As String, psConnString As String) As Object
On Error GoTo ErrorHandler
Dim oConnect As Object
Dim oRs As Object
'Create connection and recordset instances
Set oConnect= CreateObject(“ADODB.Connection”)
Set oRs = CreateObject(“ADODB.Recordset”)
'Set cursor type for recordset
'The type used here indicates that the existing records at time of
'recordset creation are updateable.
'However, additions and deletions are not seen in this instance
oRs.CursorType = adOpenKeyset ‘this is a constant, has value of 1
'Indicate the connection string required to get a connection object
' Query the database/file with SQL parameter
' Results go in recordset object
oRs.Open psSQL, oConnect
' Set the return of function to the recordset object
Set GetRecordset = oRs
' Close the recordset and the database connection
Set oRs = Nothing
Set oConnect= Nothing
sqaLogMessage sqaWarning, Error$, ""
If Err = 440 Then
sqaLogMessage sqaWarning, "Verify your SQL statement", ""
sqaConsoleWrite "Verify your SQL statement "