description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: IRowsetUpdateImpl Class |
IRowsetUpdateImpl Class |
11/04/2016 |
|
|
f85af76b-ab6f-4f8b-8f4a-337c9679d68f |
The OLE DB Templates implementation of the IRowsetUpdate interface.
template <
class T,
class Storage,
class UpdateArray = CAtlArray<Storage>,
class RowClass = CSimpleRow,
class MapClass = CAtlMap <RowClass::KeyType, RowClass*>
>
class IRowsetUpdateImpl : public IRowsetChangeImpl<
T,
Storage,
IRowsetUpdate,
RowClass,
MapClass>
T
A class derived from IRowsetUpdateImpl
.
Storage
The user record.
UpdateArray
An array containing cached data for updating the rowset.
RowClass
The storage unit for the HROW
.
MapClass
The storage unit for all row handles held by the provider.
Header: atldb.h
Name | Description |
---|---|
SetData | Sets data values in one or more columns. |
Name | Description |
---|---|
GetOriginalData | Gets the data most recently transmitted to or obtained from the data source, ignoring pending changes. |
GetPendingRows | Returns a list of rows with pending changes. |
GetRowStatus | Returns the status of specified rows. |
Undo | Undoes any changes to the row since the last fetch or update. |
Update | Transmits any changes made to the row since the last fetch or update. |
Name | Description |
---|---|
IsUpdateAllowed | Used to check for security, integrity, and so on before allowing updates. |
Name | Description |
---|---|
m_mapCachedData | Contains the original data for the deferred operation. |
You should first read and understand the documentation for IRowsetChange, because everything described there also applies here. You should also read chapter 6 of the OLE DB Programmer's Reference on setting data.
IRowsetUpdateImpl
implements the OLE DB IRowsetUpdate
interface, which enables consumers to delay the transmission of changes made with IRowsetChange
to the data source and undo changes before transmission.
Important
It is strongly recommended that you read the following documentation BEFORE attempting to implement your provider:
-
Chapter 6 of the OLE DB Programmer's Reference
-
Also see how the
RUpdateRowset
class is used in the UpdatePV sample
Sets data values in one or more columns.
STDMETHOD (SetData )(HROW hRow,
HACCESSOR hAccessor,
void* pSrcData);
See IRowsetChange::SetData in the OLE DB Programmer's Reference.
This method overrides the IRowsetChangeImpl::SetData method but includes caching of original data to permit either immediate or deferred processing of the operation.
Gets the data most recently transmitted to or obtained from the data source, ignoring pending changes.
STDMETHOD (GetOriginalData )(HROW hRow,
HACCESSOR hAccessor,
void* pData);
See IRowsetUpdate::GetOriginalData in the OLE DB Programmer's Reference.
Returns a list of rows with pending changes.
STDMETHOD (GetPendingRows )(HCHAPTER /* hReserved */,
DBPENDINGSTATUS dwRowStatus,
DBCOUNTITEM* pcPendingRows,
HROW** prgPendingRows,
DBPENDINGSTATUS** prgPendingStatus);
hReserved
[in] Corresponds to the hChapter parameter in IRowsetUpdate::GetPendingRows.
For other parameters, see IRowsetUpdate::GetPendingRows in the OLE DB Programmer's Reference.
For more information, see IRowsetUpdate::GetPendingRows in the OLE DB Programmer's Reference.
Returns the status of specified rows.
STDMETHOD (GetRowStatus )(HCHAPTER /* hReserved */,
DBCOUNTITEM cRows,
const HROW rghRows[],
DBPENDINGSTATUS rgPendingStatus[]);
hReserved
[in] Corresponds to the hChapter parameter in IRowsetUpdate::GetRowStatus.
For other parameters, see IRowsetUpdate::GetRowStatus in the OLE DB Programmer's Reference.
Undoes any changes to the row since the last fetch or update.
STDMETHOD (Undo )(HCHAPTER /* hReserved */,
DBCOUNTITEM cRows,
const HROW rghRows[ ],
DBCOUNTITEM* pcRowsUndone,
HROW** prgRowsUndone,
DBROWSTATUS** prgRowStatus);
hReserved
[in] Corresponds to the hChapter parameter in IRowsetUpdate::Undo.
pcRowsUndone
[out] Corresponds to the pcRows parameter in IRowsetUpdate::Undo.
prgRowsUndone
[in] Corresponds to the prgRows parameter in IRowsetUpdate::Undo.
For other parameters, see IRowsetUpdate::Undo in the OLE DB Programmer's Reference.
Transmits any changes made to the row since the last fetch or update.
STDMETHOD (Update )(HCHAPTER /* hReserved */,
DBCOUNTITEM cRows,
const HROW rghRows[],
DBCOUNTITEM* pcRows,
HROW** prgRows,
DBROWSTATUS** prgRowStatus);
hReserved
[in] Corresponds to the hChapter parameter in IRowsetUpdate::Update.
For other parameters, see IRowsetUpdate::Update in the OLE DB Programmer's Reference.
Changes are transmitted by calling IRowsetChangeImpl::FlushData. The consumer must call CRowset::Update for the changes to take effect. Set prgRowstatus to an appropriate value as described in Row States in the OLE DB Programmer's Reference.
Override this method to check for security, integrity, and so on before updates.
HRESULT IsUpdateAllowed(DBPENDINGSTATUS /* [in] */ /* status */,
HROW /* [in] */ /* hRowUpdate */,
DBROWSTATUS* /* [out] */ /* pRowStatus */);
status
[in] The status of pending operations on the rows.
hRowUpdate
[in] Handle for the rows the user wants to update.
pRowStatus
[out] The status returned to the user.
If you determine that an update should be allowed, returns S_OK; otherwise returns E_FAIL. If you allow an update, you also need to set the DBROWSTATUS
in IRowsetUpdateImpl::Update to an appropriate row state.
A map containing the original data for the deferred operation.
CAtlMap<
HROW hRow,
Storage* pData
>
m_mapCachedData;
hRow
Handle to the rows for the data.
pData
A pointer to the data to be cached. The data is of type Storage (the user record class). See the Storage template argument in IRowsetUpdateImpl Class.
OLE DB Provider Templates
OLE DB Provider Template Architecture
Creating an Updatable Provider