Resources

OLE DB Format Processing:
Using the SASFORMAT Structure

Use the SASFORMAT structure (defined by SASExtensions.idl) to bind SAS format processing to columns during read, write, and update operations. To perform the binding operation, you call the IAccessor::CreateAccessor method. The following code shows the SASFORMAT structure:

typedef enum
{
    SASFMT_FORMAT,
    SASFMT_INFORMAT
} SASFMTENUM;

typedef struct tagSASFORMAT
{
    SASFMTENUM          wType;
    LPOLESTR            pwszName;
    SHORT               iLength;
    SHORT               iDecimals;
} SASFORMAT;

The following table explains how the elements of the SASFORMAT structure are used:

Element Description
wType Indicates whether a particular instance of a SASFORMAT structure applies to a column's format (SASFMT_FORMAT) or informat (SASFMT_INFORMAT).
pwszName Pointer to the name (as a string) of the format or informat that should be used to override the column's default format.
iLength Specifies the width to apply to the format or informat. If this value is nonzero, it will override the column's default format.
iDecimals Specifies the number of significant decimal places that should be used when applying numeric formats or informats. If this is nonzero, it will override the associated column's default format.

See the following topics for more information about how to use SASFORMAT in order to make formats and informats available to client applications. They explain how to apply formats using the IAccessor::CreateAccessor method on rowsets returned by IOpenRowset::OpenRowset and ICommand::Execute.


See Also:

About Format and Informat Processing with OLE DB