Export (0) Print
Expand All

IRowsetFastLoad::InsertRow (OLE DB)

SQL Server 2000

IRowsetFastLoad::InsertRow (OLE DB)

Adds a row to the bulk-copy rowset.

Syntax

HRESULT InsertRow(
HACCESSOR hAccessor,
void* pData);

Arguments

hAccessor [in]

Is the handle of the accessor defining the row data for bulk copy. The accessor referenced is a row accessor, binding consumer-owned memory containing data values.

pData [in]

Is a pointer to the consumer-owned memory containing data values.

Return Code Values

S_OK

The method succeeded. Any bound status values for all columns have value DBSTATUS_S_OK or DBSTATUS_S_NULL.

E_FAIL

An error occurred. Error information is available from the rowset's error interfaces.

E_INVALIDARG

pData was a NULL pointer.

E_OUTOFMEMORY

SQLOLEDB was unable to allocate sufficient memory to complete the request.

E_UNEXPECTED

The method was called on a bulk-copy rowset previously invalidated by IRowsetFastLoad::Commit(TRUE).

DB_E_BADACCESSORHANDLE

The hAccessor provided by the consumer was invalid.

DB_E_BADACCESSORTYPE

The specified accessor was not a row accessor or did not specify consumer-owned memory.

Remarks

An error converting consumer data to the Microsoft® SQL Server™ 2000 data type for a column causes an E_FAIL return from SQLOLEDB. Data can be transmitted to SQL Server on any InsertRow or only on Commit. Therefore, the consumer application can call InsertRow many times with erroneous data before it receives notice that a data type conversion error exists. Because Commit ensures that all data is correctly specified by the consumer, the consumer can use Commit appropriately to validate data as necessary.

SQLOLEDB bulk-copy rowsets are write-only. SQLOLEDB exposes no methods allowing consumer query of the rowset. To terminate processing, the consumer can release its reference on IRowsetFastLoad without calling Commit. There are no facilities for accessing a consumer-inserted row in the rowset and changing its values, or removing it individually from the rowset.

Bulk-copied rows are formatted on the server for SQL Server version 7.0. The row format is affected by any options that may have been set for the connection or session such as ANSI_PADDING. This option is set on by default for any connection made through SQLOLEDB. If connected to SQL Server 6.5, the bulk-copied rows are formatted on the client and none of the option settings have any effect.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft