IRowsetFastLoad::Commit (OLE DB)

OLE DB and SQL Server

OLE DB and SQL Server

IRowsetFastLoad::Commit (OLE DB)

Marks the end of a batch of inserted rows and writes the rows to the Microsoft® SQL Server™ 2000 table.

Syntax

HRESULT Commit( BOOLEAN bDone);

Arguments

bDone [in]

If FALSE, the rowset maintains validity and can be used by the consumer for additional row insertion. If TRUE, the rowset loses validity and no further insertion can be done by the consumer.

Return Code Values

S_OK

The method succeeded and all inserted data has been written to the SQL Server 2000 table.

E_FAIL

An error occurred.

E_UNEXPECTED

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

Remarks

A SQLOLEDB bulk-copy rowset behaves as a delayed-update mode rowset. As the user inserts row data through the rowset, inserted rows are treated in the same fashion as pending inserts on a rowset supporting IRowsetUpdate.

The consumer must call Commit on the bulk-copy rowset to write inserted rows to the SQL Server 2000 table in the same way as the IRowsetUpdate::Update member function is used to submit pending rows to an instance of SQL Server 2000.

If the consumer releases its reference on the bulk-copy rowset without calling Commit, all inserted rows not previously written are lost.

The consumer can batch inserted rows by calling Commit with bDone FALSE. When bDone is TRUE, the rowset becomes invalid. An invalid bulk-copy rowset supports only ISupportErrorInfo and IRowsetFastLoad::Release.