CopyFromRecordset Method

         Example         Applies To

Copies the contents of an ADO or DAO Recordset object onto a worksheet, beginning at the upper-left corner of the specified range. If the Recordset object contains fields with OLE objects in them, this method fails.

Syntax

expression.CopyFromRecordset(Data, MaxRows, MaxColumns)

expression   Required. An expression that returns a Range object.

Data   Required Void. The Recordset object to copy into the range.

MaxRows   Optional Variant. The maximum number of records to copy onto the worksheet. If this argument is omitted, all the records in the Recordset object are copied.

MaxColumns   Optional Variant. The maximum number of fields to copy onto the worksheet. If this argument is omitted, all the fields in the Recordset object are copied.

Remarks

Copying begins at the current row of the Recordset object. After copying is completed, the EOF property of the Recordset object is True.