Skip Headers

Oracle® Objects for OLE C++ Class Library Developer's Guide
10g Release 1 (10.1)

Part Number B10119-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

CopyToClipboard Method

Applies To

ODynaset

Description

Copy rows from the dynaset to Windows Clipboard in text format.

Usage

oresult CopyToClipboard(NumOfRows)

oresult CopyToClipboard(NumOfRows ,colsep,rowsep)

Arguments
Description
NumOfRows
Maximum number of rows to be copied to the dynaset
colsep
Column separator in char to be inserted between columns, if 0 then TAB (ASCII 9) will be used
rowsep
Row separator in char to be inserted between Rows, if 0 then NEWLINE (ASCII 13) will be used
Remarks

This method is used to facilitate transfer of data between Oracle Object for OLE's cache (dynaset) and Windows applications such as Excel or Word. CopyToClipboard copies data starting from current position of the dynaset up to the last row.

Default column separator is TAB (ASCII 9).

Default row separator is ENTER (ASCII 13).

This function uses CF_TEXT internally to copy the data to the clipboard, thus, trying copy the data other than in text format does not work.

Return Value

An oresult indicating whether the operation succeeded (OSUCCESS) or not (OFAILURE).

Example

This example copies the data to the ClipBoard.

// open the database
ODatabase odb("ExampleDB", "scott", "tiger");

// open a dynaset on the orders table
ODynaset orderdyn(odb, "select * from ord");

// copies the entire data to the clipboard
orderdyn.CopyToClipboard(-1, '\t', '\n');