MDAC 2.5 SDK - Technical Articles


 

Mapping ADO Methods to OLE DB Interfaces

Use the following information as a guide for conformance testing.

OLE DB Interfaces ADO Requires

IAccessor

IColumnsInfo

IConvertType

IDBCreateSession

IDBInitialize

IDBProperties

IOpenRowset

IRowset

IRowsetInfo

ISourcesRowset

Note   ISourcesRowset is implemented in the OLE DB enumerator provided in the MSDA SDK. It is required only if the provider friendly name is used instead of ProgID.

OLE DB Interfaces ADO Uses, If Available

IColumnsRowset

ICommand

ICommandPrepare

ICommandProperties

ICommandText

ICommandWithParameters

IDBCreateCommand

IDBDataSourceAdmin

IDBInfo

IDBSchemaRowset

IErrorInfo

IErrorRecords

IIndexDefinition

IRowsetChange

IRowsetIndex

IRowsetLocate

IRowsetNotify

IRowsetResynch

IRowsetScroll

IRowsetUpdate

IRowsetView

ISQLErrorInfo

ITableDefinition

ITransaction

ITransactionLocal

IViewChapter

IViewFilter

IViewSort

OLE DB Interfaces Not Used by ADO

IGetDataSource

IRowsetIdentity

ISessionProperties

ISupportErrorInfo

ITransactionJoin

ITransactionObject

ITransactionOptions

OLE DB Interfaces Used by ADO 2.1

IDBDataSourceAdmin

IIndexDefinition

IRowsetIndex

ITableDefinition

OLE DB Interfaces Used by ADO 2.5

IBindResource

IColumnsInfo

ICreateRow

IDBBinderProperties

IRow

CursorType to Rowset Properties Mapping

adOpenForwardOnly All cursor types,
DBPROP_IRowset,
DBPROP_ISequentialStream,
DBPROP_IColumnsRowset
adOpenKeyset DBPROP_OWNUPDATEDELETE,
DBPROP_OWNINSERT,
DBPROP_OTHERUPDATEDELETE,
DBPROP_IRowsetLocate,
DBPROP_CANSCROLLBACKWARDS,
DBPROP_CANFETCHBACKWARDS,
DBPROP_CANHOLDROWS,
DBPROP_IRowsetRefresh,
DBPROP_REMOVEDELETED
adOpenStatic DBPROP_OWNUPDATEDELETE,
DBPROP_OWNINSERT,
DBPROP_IRowsetLocate,
DBPROP_CANSCROLLBACKWARDS,
DBPROP_CANFETCHBACKWARDS,
DBPROP_CANHOLDROWS,
DBPROP_IRowsetRefresh
adOpenDynamic DBPROP_OWNUPDATEDELETE,
DBPROP_OWNINSERT,
DBPROP_OTHERUPDATEDELETE,
DBPROP_OTHERINSERT,
DBPROP_CANSCROLLBACKWARDS,
DBPROP_CANFETCHBACKWARDS,
DBPROP_REMOVEDELETED

LockType to Rowset Properties Mapping

adLockReadOnly None
adLockOptimistic DBPROP_IRowsetChange,
DBPROP_UPDATABILITY,
DBPROP_IRowsetUpdate
adLockPessimistic DBPROP_IRowsetChange,
DBPROP_UPDATABILITY,
DBPROP_IRowsetUpdate
adLockBatchOptimistic DBPROP_IRowsetChange,
DBPROP_UPDATABILITY,
DBPROP_IRowsetUpdate

ADO Objects to OLE DB Methods

The following table maps the methods, properties, and collections of ADO objects to the corresponding OLE DB methods called.

Note   ADO caches information and defers the call to the OLE DB method.

ADO object OLE DB method
Command object  
  Method  
  Cancel None
  CreateParameter None
  Execute ICommand::Execute
  Property  
  ActiveConnection None
  CommandText ICommandText::GetCommandText and
ICommandText::SetCommandText
  CommandTimeout ICommandProperties::SetProperties
(DBPROP_COMMANDTIMEOUT)
  CommandType None
  Name None
  Prepared ICommandPrepare::Prepare and
ICommandPrepare::Unprepare
  State None
  Collection  
  Parameters Get: ICommandWithParameters::GetParameterInfo or
DBSCHEMA_PROCEDURE_PARAMETERS schema rowset


Set: ICommandWithParameters::SetParameterInfo

  Properties IDBProperties::GetPropertyInfo,
ICommandProperties::GetProperties and
ICommandProperties::SetProperties
   
Connection object  
  Method  
  BeginTrans ITransactionLocal::StartTransaction
  Cancel None
  Close None
  CommitTrans ITransactionLocal::Commit
  Execute ICommand::Execute or
IOpenRowset::OpenRowset
  Open IDBInitialize::Initialize and
IDBCreateSession::CreateSession
  OpenSchema IDBSchemaRowset::GetRowset
  RollBack ITransactionLocal::Abort
  Event  
  BeginTransComplete None
  CommitTransComplete None
  ConnectComplete None
  Disconnect None
  ExecuteComplete None
  InfoMessage None
  RollbackTransComplete None
  WillConnect None
  WillExecute None
  Property  
  Attributes ITransactionLocal::StartTransaction
  CommandTimeout ICommandProperties::SetProperties
(DBPROP_COMMANDTIMEOUT)
  ConnectionString None
  ConnectionTimeout IDBProperties::SetProperties
(DBPROP_INIT_TIMEOUT)
  CursorLocation None
  DefaultDatabase IDBProperties::GetProperties
(DBPROP_CURRENTCATALOG) and
IDBProperties::SetProperties
(DBPROP_CURRENTCATALOG)
  IsolationLevel ITransactionLocal::StartTransaction
  Mode IDBProperties::GetProperties
(DBPROP_INIT_MODE) and
IDBProperties::SetProperties
(DBPROP_INIT_MODE)
  Provider ISourcesRowset::GetSourcesRowset
  State None
  Version None
  Collection  
  Errors IErrorRecords
  Properties IDBProperties::GetPropertyInfo,
IDBProperties::GetProperties and
IDBProperties::SetProperties
   
Error object  
  Method  
  None None
  Property  
  Description IErrorRecords::GetErrorInfo
  HelpContext IErrorRecords::GetErrorInfo
  HelpFile IErrorRecords::GetErrorInfo
  NativeError IErrorRecords::GetCustomErrorObject and
ISQLErrorInfo::GetSQLInfo
  Number None
  Source IErrorRecords::GetErrorInfo
  SQLState IErrorRecords::GetCustomErrorObject and
ISQLErrorInfo::GetSQLInfo
  Collection  
  None None
   
Field object  
  Method  
  AppendChunk ISequentialStream::Write
  GetChunk IStream::Seek and IStream::Read,
ILockBytes::ReadAt or
ISequentialStream::Read
  Property  
  ActualSize IAccessor::CreateAccessor and
IRowset::GetData
  Attributes IColumnsInfo::GetColumnInfo
  DataFormat IColumnsInfo::GetColumnInfo
  DefinedSize IColumnsInfo::GetColumnInfo
  Name IColumnsInfo::GetColumnInfo
  NumericScale IColumnsInfo::GetColumnInfo
  OriginalValue IRowsetUpdate::GetOriginalData
  Precision IColumnsInfo::GetColumnInfo
  Type IColumnsInfo::GetColumnInfo
  UnderlyingValue IRowsetRefresh::GetLastVisibleData or
IRowsetResynch::GetVisibleData
  Value IAccessor::CreateAccessor and
IRowset::GetData and IRowsetChange::SetData
  Collection  
  Properties IDBProperties::GetPropertyInfo,
IRowsetInfo::GetProperties and
IRowsetInfo::SetProperties
Parameter object  
  Method  
  AppendChunk None
  Property  
  Attributes Get: ICommandWithParameters::GetParameterInfo or
DBSCHEMA_PROCEDURE_PARAMETERS schema rowset


Set: ICommandWithParameters::SetParameterInfo

  Direction Get: ICommandWithParameters::GetParameterInfo or
DBSCHEMA_PROCEDURE_PARAMETERS schema rowset


Set: ICommandWithParameters::SetParameterInfo

  Name Get: ICommandWithParameters::GetParameterInfo or
DBSCHEMA_PROCEDURE_PARAMETERS schema rowset

 
Set:
ICommandWithParameters::SetParameterInfo

  NumericScale Get: ICommandWithParameters::GetParameterInfo or
DBSCHEMA_PROCEDURE_PARAMETERS schema rowset


Set: ICommandWithParameters::SetParameterInfo

  Precision Get: ICommandWithParameters::GetParameterInfo or
DBSCHEMA_PROCEDURE_PARAMETERS schema rowset


Set: ICommandWithParameters::SetParameterInfo

  Size Get: ICommandWithParameters::GetParameterInfo or
DBSCHEMA_PROCEDURE_PARAMETERS schema rowset


Set: ICommandWithParameters::SetParameterInfo

  Type Get: ICommandWithParameters::GetParameterInfo or
DBSCHEMA_PROCEDURE_PARAMETERS schema rowset


Set: ICommandWithParameters::SetParameterInfo

  Value IAccessor::CreateAccessor and
ICommand::Execute
  Collection  
  Properties None
   
Record object  
  Method  
  Cancel None
  Close None
  CopyRecord IScopedOperations::Copy
  DeleteRecord IScopedOperations:Delete
  GetChildren IBindResource::Bind
  MoveRecord IScopedOperations::Move
  Open IBindResource::Bind
  Property  
  ActiveConnection None
  Mode None
  ParentURL IRow::GetColumns
  RecordType None
  Source None
  State IDBAsynchStatus::GetStatus
  Collection  
  Fields None
  Properties None
   
Recordset object  
  Method  
  AddNew IRowsetChange::InsertRow
  Cancel None
  CancelBatch IRowsetUpdate::Undo
  CancelUpdate None
  Clone IRowsetLocate
  Close IAccessor::ReleaseAccessor,
IRowset::ReleaseRows
  CompareBookmarks None
  Delete IRowsetChange::DeleteRows
  Find None
  GetRows IAccessor::CreateAccessor,
IRowsetLocate::GetRowsAt,
IRowset::GetNextRows, and
IRowset::GetData
  GetString None
  Move IRowsetLocate::GetRowsAt or
IRowset::GetNextRows
  MoveFirst IRowsetLocate::GetRowsAt or
IRowset::RestartPosition
  MoveLast IRowsetLocate::GetRowsAt
  MoveNext IRowsetLocate::GetRowsAt or
IRowset::GetNextRows
  MovePrevious IRowsetLocate::GetRowsAt or
IRowset::GetNextRows
  NextRecordset IMultipleResults::GetResult
  Open IOpenRowset::OpenRowset or
ICommand::Execute
  Requery IOpenRowset::OpenRowset or
ICommand::Execute
  Resync IRowsetRefresh::RefreshVisibleData
  Supports IRowsetInfo::GetProperties
  Save None
  Seek None
  Update IRowsetChange::SetData and/or
IRowsetUpdate::Update
  UpdateBatch IRowsetUpdate::Update
  Event  
  EndOfRecordset None
  FetchComplete None
  FetchProgress None
  FieldChangeComplete None
  MoveComplete None
  RecordChangeComplete None
  RecordsetChangeComplete None
  WillChangeField None
  WillChangeRecord None
  WillChangeRecordset None
  WillMove None
  Property  
  AbsolutePage Get: IRowsetScroll::GetApproximatePosition


Set: IRowsetScroll::GetRowsAtRatio or
IRowsetLocate::GetRowsAt

  AbsolutePosition Get: IRowsetScroll::GetApproximatePosition


Set: IRowsetScroll::GetRowsAtRatio or
IRowsetLocate::GetRowsAt

  ActiveCommand None
  ActiveConnection IDBInitialize::Initialize and
IDBCreateSession::CreateSession
  BOF None
  Bookmark IAccessor::CreateAccessor and
IRowsetLocate::GetRowsAt
  CacheSize cRows argument to IRowsetLocate::GetRowsAt or
IRowset::GetNextRows
  CursorLocation None
  CursorType ICommandProperties::SetProperties
  DataMember None
  DataSource None
  EditMode IRowsetUpdate::GetRowsStatus
  EOF None
  Filter IRowsetUpdate::GetPendingRows and
IRowsetLocate::GetRowsByBookmark OR
IRowsetView::CreateView and
IViewChapter::OpenViewChapter and
IViewFilter::SetFilter
  Index None
  LockType ICommandProperties::SetProperties
  MarshalOptions None
  MaxRecords IOpenRowset::OpenRowset
(DBPROP_MAXROWS) or
ICommandProperties::SetProperties
(DBPROP_MAXROWS)
  PageCount IRowsetScroll::GetApproximatePosition
  PageSize None
  RecordCount IRowsetScroll::GetApproximatePosition
  Sort None
  Source None
  State None
  Status IRowsetUpdate::GetRowStatus
  StayInSync None
  Collection  
  Fields IColumnsInfo::GetColumnInfo
  Properties IDBProperties::GetPropertyInfo,
IRowsetInfo::GetProperties and
IRowsetInfo::SetProperties
   
Stream object  
  Method  
  Cancel None
  Close None
  CopyTo IStream::CopyTo
  Flush None
  LoadFromFile None
  Open IBindResource::Bind
  Read IStream::Stat, IStream::Read
  ReadText None
  SaveToFile None
  SetEOS IStream::Seek, IStream::SetSize
  SkipLine IStream::Seek, IStream::Read
  Write IStream::Write
  WriteText None
  Property  
  Charset None
  EOS IStream::Stat, IStream::Seek
  LineSeparator None
  Mode None
  Position IStream::Seek
  Size IStream::SetSize
  State IDBAsynchStatus::GetStatus
  Type None

ADO Collections to OLE DB Methods

The following table maps the methods and properties of ADO collections to the corresponding OLE DB methods called.

ADO collection OLE DB method
Errors collection  
  Method  
  Clear None
  Refresh None
  Property  
  Count None
  Item None
   
Fields collection  
  Method  
  Append None
  Delete None
  Refresh None
  Update IRowSchemaChange::AddColumns and
IRowSchemaChange::DeleteColumns
  Property  
  Count None
  Item IRow::Open,
IRowChange::SetColumns,
IRow::GetColumns,
IColumnsInfo::GetColumnInfo
   
Parameters collection  
  Method  
  Append None
  Delete None
  Refresh None
  Property  
  Count None
  Item None
   
Properties collection  
  Method  
  Refresh None
  Property  
  Count None
  Item None