SQL Object
 
Syntax
 
SQL.RunQueryLoadArray2D Query, MyArray[, Timeout]
 
Description
Performs a query and loads the the entire record set into a two-dimensional array variable. All records are loaded into the array, with a maximum of 32767 rows.
 
The first dimension of the array contains the lines of the record set; the second dimension contains the individual fields.
 
In addition to rows and columns of the record set, the array also contains additional information:
 
myArray(0,0) contains the number of lines of the recordset
myArray(0,1..n) contains the column names of the recordset
 
myArray(1,1) contains the first column of the first row
...
 
Parameter
Description
Query
A reference to a SELECT query.
MyArray
A variable of type two-dimensional Array (string) into which the record set is loaded (max 32767 rows).
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, RunQueryLoadArray.
Example
 
Sub Main
 
   Dim Query As String
   Dim myArr() As String
 
   Query = "SELECT * FROM Prm_FeestDagen"
   SQL.RunQueryLoadArray2D Query, myArr()
 
   Dim x As Integer, y As Integer
   For x = 0 To UBound(myArr,1)
      For y = 0 To UBound(myArr,2)
         Debug.Print x & vbTab & y & vbTab & myArr(x,y)
      Next y
   Next x
 
End Sub