Range.CopyFromRecordset(Object, Object, Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Copies the contents of an ADO or DAO Recordset object onto a worksheet, beginning at the upper-left corner of the specified range.
public int CopyFromRecordset (object Data, object MaxRows, object MaxColumns);
Public Function CopyFromRecordset (Data As Object, Optional MaxRows As Object, Optional MaxColumns As Object) As Integer
Parameters
- Data
- Object
Required Object. The Recordset object to copy into the range.
- MaxRows
- Object
Optional Object. 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
- Object
Optional Object. The maximum number of fields to copy onto the worksheet. If this argument is omitted, all the fields in the Recordset object are copied.
Returns
Remarks
If the Recordset object contains fields with OLE objects in them, this method fails.
Copying begins at the current row of the Recordset object. After copying is completed, the EOF property of the Recordset object is True.