XArrayDB Reference > XArrayDB Methods > LoadRows Method (XArrayDB) |
This method populates an XArrayDB object from a two-dimensional variant array.
XArrayDB.LoadRows array, [transpose]
array is a variant array containing the data to be loaded.
transpose is an optional Boolean argument that determines whether the array data should be transposed.
Typically, the array is derived from a data provider such as ADO or RDO, but it can also be a standard Visual Basic array..
If the transpose argument is True (default), the array elements are copied in row-major order. If transpose is False, or omitted, the array elements are copied in column-major order. The argument should be False if you are using the GetRows method (of the ADO Recordset), and True if you are using a standard Visual Basic array.
The following example copies ten rows of data from a DAO Recordset to an XArrayDB object in column-major order, then associates the XArrayDB object with a TDBGrid control. Note that it is not necessary to invoke the ReDim method when using LoadRows:
MyArray.LoadRows Data1.Recordset.GetRows(10)