XArrayDB Reference > XArrayDB Members > XArrayDB Object Methods > LoadRows Method (XArrayDB) |
XArrayDB.LoadRows array, [transpose]
Method applies to XArrayDB object.
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
Description
This method populates an XArrayDB object from a two-dimensional variant array. 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 TData 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 TData1.Array = MyArray
TData1.ReBind