Compartir a través de


IAccessor::GetBindings

Returns the bindings in an accessor.

Syntax

HRESULT GetBindings (
   HACCESSOR           hAccessor,
   DBACCESSORFLAGS    *pdwAccessorFlags,
   DBCOUNTITEM        *pcBindings,
   DBBINDING         **prgBindings);

Parameters

  • hAccessor
    [in] The handle of the accessor for which to return the bindings.

  • pdwAccessorFlags
    [out] A pointer to memory in which to return a bitmask that describes the properties of the accessor and how it is intended to be used. For more information, see dwAccessorFlags in CreateAccessor. If this method fails, *pdwAccessorFlags is set to DBACCESSOR_INVALID.

  • pcBindings
    [out] A pointer to memory in which to return the number of bindings in the accessor. If this method fails, *pcBindings is set to zero.

  • prgBindings
    [out] A pointer to memory in which to return an array of DBBINDING structures. One DBBINDING structure is returned for each binding in the accessor. The provider allocates memory for these structures and any structures pointed to by elements of these structures; for example, if pObject in a binding structure is not a null pointer, the provider allocates a DBOBJECT structure for return to the consumer. The provider returns the address to the memory for these structures; the consumer releases the memory for these structures with IMalloc::Free when it no longer needs the bindings. If *pcBindings is zero on output or the method fails, the provider does not allocate any memory and ensures that *prgBindings is a null pointer on output. For information about bindings, see DBBINDING Structures.

Return Code

  • S_OK
    The method succeeded.

  • E_FAIL
    A provider-specific error occurred.

  • E_INVALIDARG
    pdwAccessorFlags, pcBindings, or prgBindings was a null pointer.

  • E_OUTOFMEMORY
    The provider was unable to allocate sufficient memory in which to return the binding structures.

  • E_UNEXPECTED
    ITransaction::Commit or ITransaction::Abort was called, and the object is in a zombie state. This error can be returned only when the method is called on a rowset.

  • DB_E_BADACCESSORHANDLE
    hAccessor was invalid.

  • DB_E_NOTREENTRANT
    The provider called a method from IRowsetNotify in the consumer that had not yet returned, and the provider does not support reentrancy in this method.

Comments

This method makes no logical change to the state of the object.

If the accessor is a null accessor, the method sets *pcBindings to zero and *prgBindings to a null pointer.

See Also

Reference

IAccessor::CreateAccessor