XArrayDB Reference > XArrayDB Object Methods > LoadRows Method (XArrayDB) |
LoadRows Method (XArrayDB)
This method populates an XArrayDB object from a two-dimensional variant array.
XArrayDB.LoadRows array, [transpose]
Arguments
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.
Return Value
None
Method applies to XArrayDB object.
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.
Example
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 TDBList control. Note that it is not necessary to invoke the ReDim method when using LoadRows:
Dim MyArray As New XArrayDB
Data1.Recordset.MoveFirst
MyArray.LoadRows Data1.Recordset.GetRows(10)
Set TDBList1.Array = MyArray
TDBList1.ReBind
See Also