CDynamicStringAccessor Class

 

The latest version of this topic can be found at CDynamicStringAccessor Class.

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

Syntax

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

Members

Methods

GetString Retrieves the specified column data as a string.
SetString Sets the specified column data as a string.

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

OLE DB Consumer Templates
OLE DB Consumer Templates Reference
CAccessor Class
CDynamicParameterAccessor Class
CManualAccessor Class
CDynamicAccessor Class
CDynamicStringAccessorA Class
CDynamicStringAccessorW Class
CXMLAccessor Class