Dela via


CDynamicStringAccessor Class

Allows you to access a data source when you have no knowledge of the database schema (the database's underlying structure).

template< typename BaseType, DBTYPEENUM OleDbType >
class CDynamicStringAccessorT : public CDynamicAccessor

Remarks

While CDynamicAccessor requests data in the native format reported by the provider, CDynamicStringAccessor requests that the provider fetch all data accessed from the data store as string data. This is especially useful for simple tasks that do not require calculation of values in the data store, such as displaying or printing the data store's contents.

The native type of column data in the data store does not matter; as long as the provider can support the data conversion, it will supply the data in string format. If the provider does not support the conversion from the native data type to a string (which is not common), the requesting call will return the success value DB_S_ERRORSOCCURED, and the status for the corresponding column will indicate a conversion problem with DBSTATUS_E_CANTCONVERTVALUE.

Use CDynamicStringAccessor methods to obtain column information. You use this column information to create an accessor dynamically at run time.

The column information is stored in a buffer created and managed by this class. Obtain data from the buffer using GetString, or store it to the buffer using SetString.

For a discussion and examples of using the dynamic accessor classes, see Using Dynamic Accessors.

Requirements

Header: atldbcli.h

See Also

Reference

CAccessor Class

CDynamicParameterAccessor Class

CManualAccessor Class

CDynamicAccessor Class

CDynamicStringAccessorA Class

CDynamicStringAccessorW Class

CXMLAccessor Class

Concepts

OLE DB Consumer Templates (C++)

OLE DB Consumer Templates Reference

Other Resources

CDynamicAccessor Members