SQL Object
 
Syntax
 
SQL.RunQueryLoadArray Query, MyArray[, MyArray2][, MyArray3][, Timeout]
 
Description
Performs a query and loads the first column (and optionally 2nd and 3rd columns) into an array variable. All records are loaded into the array, with a maximum of 32767 rows.
 
Parameter
Description
Query
A reference to a SELECT query.
MyArray
A variable of type Array (string) into which the record set is loaded (max 32767 rows).
MyArray2
Optional. an additional Array string variable containing the 2nd column from the query.
MyArray3
Optional. an additional Array string variable containing the 3rd column from the query.
Timeout
Optional. The number of seconds in which the test must be completed. If not specified, the timeout is 30 seconds.
 
See Also
other SQL.Runxxxxxxxx methodes, RunQueryLoadArray2D.
Example
Sub Main()
 
    Dim Query As String
    Dim myArr() As String
    Dim myArr2() As String
 
    Query = "SELECT Code, Omschrijving FROM Prm_OrderStatus"
 
    SQL.RunQueryLoadArray Query, myArr(), myArr2()
 
    Dim x As Integer
 
    For x = 0 To UBound(myArr)
        Debug.Print myArr(x) & vbTab & myArr2(x)
    Next x
 
End Sub