IAccessor::CreateAccessor
Creates an accessor from a set of bindings.
For general information about accessors, see Accessors in Getting and Setting Data (OLE DB).
IAccessor::CreateAccessor always checks all error conditions that do not require it to validate the accessor against the metadata. As a general rule, this means it checks the error conditions for all of the return codes except those that return DB_E_ERRORSOCCURRED. CreateAccessor may validate the accessor against the metadata for row accessors created on the rowset; it never validates the accessor against the metadata for row or parameter accessors created on the command. When CreateAccessor validates the accessor against the metadata, it validates each binding in the accessor, setting the appropriate DBBINDSTATUS values as it goes. If CreateAccessor fails in any way, it does not create the accessor and sets *phAccessor to a null handle.
If IAccessor::CreateAccessor does not validate the accessor against the metadata, the validation is said to be delayed. CreateAccessor simply creates the accessor and validation is done by the first method that uses the accessor. If the accessor is found to be invalid, it remains in existence and can be used again.
If accessor validation is delayed, the provider determines whether the method validating the accessor validates it against the metadata before or during data transfer. If the method validates the accessor before transferring any data, it can return any of the return codes listed below for this purpose. If the method validates the accessor while transferring the data, it sets the status value of any column or parameter for which the accessor is invalid (within the context of the method) to DBSTATUS_E_BADACCESSOR and returns DB_S_ERRORSOCCURRED or DB_E_ERRORSOCCURRED. Whether the method continues processing other columns or parameters depends on both the method and the provider.
The return codes listed in the following table are returned by methods that perform delayed accessor validation before transferring any data. The DBBINDSTATUS value to which each corresponds is also listed.
|
Return code |
DBBINDSTATUS value |
|---|---|
|
E_NOINTERFACE |
DBBINDSTATUS_NOINTERFACE |
|
DB_E_BADBINDINFO |
DBBINDSTATUS_BADBINDINFO |
|
DB_E_BADORDINAL |
DBBINDSTATUS_BADORDINAL |
|
DB_E_BADSTORAGEFLAGS |
DBBINDSTATUS_BADSTORAGEFLAGS |
|
DB_E_UNSUPPORTEDCONVERSION |
DBBINDSTATUS_UNSUPPORTEDCONVERSION |
Providers that do not support conversion of BLOB or non-BLOB data to a data structured storage interface should fail the accessor creation method with DB_E_ERRORSOCCURRED and report DBBINDSTATUS_UNSUPPORTEDCONVERSION on the column specifying the incorrect binding.