Data Type Conversion

OLE DB Programmer's Reference

Providers must be able to convert bound data values as follows:

  • To the native type used by the provider for the column or parameter, as returned by IColumnsInfo::GetColumnInfo or ICommandWithParameters::GetParameterInfo. Such transfers must be performed without loss of data.
  • To and from DBTYPE_WSTR if such a conversion is defined by OLE DB. For more information, see "Conversion Tables" in Appendix A: Data Types. Conversions to and from DBTYPE_WSTR are defined for virtually all types.

Support for additional conversions is optional and might result in truncation of data or a conversion error. The consumer can determine what conversions a provider supports by calling IConvertType::CanConvert with the indicators for the "to" and "from" types. If a provider offers additional functions that the consumer can call to convert data types, these functions are described in a type library pointed to by the PROVIDER_TYPES schema rowset.

For more information about how data is converted, see "Data Type Conversion Rules" in Appendix A: Data Types.

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net