次の方法で共有


NamedRange.CopyFromRecordset(Object, Object, Object) Method

Definition

Copies the contents of an ADO or DAO recordset into a worksheet, beginning at the upper-left corner of the NamedRange control.

public int CopyFromRecordset (object Data, object MaxRows, object MaxColumns);
abstract member CopyFromRecordset : obj * obj * obj -> int
Public Function CopyFromRecordset (Data As Object, Optional MaxRows As Object, Optional MaxColumns As Object) As Integer

Parameters

Data
Object

The recordset to copy into the range.

MaxRows
Object

The maximum number of records to copy into the worksheet. If this argument is omitted, all the records in the recordset object are copied.

MaxColumns
Object

The maximum number of fields to copy into the worksheet. If this argument is omitted, all the fields in the recordset object are copied.

Returns

Remarks

If the recordset contains fields with OLE objects in them, this method fails.

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

Optional Parameters

For information on optional parameters, see Optional Parameters in Office Solutions.

Applies to