The following formats are used for conversions to and from strings. Only nontrivial formats are listed. Converting a string to a nonstring type may fail for some providers if the string contains trailing blanks.
Type indicator | Format |
DBTYPE_BYTES | When strings are converted to and from binary data, each byte of binary data is represented as two ASCII characters. These characters are the ASCII character representation of the number in its hexadecimal form. For example, a binary 00000001 is converted to "01" and a binary 11111111 is converted to "FF". |
DBTYPE_CY | "...cccc.cccc" |
DBTYPE_BOOL | "True" and "False" |
DBTYPE_DATE | As in Automation, according to the regional settings of the machine. For example, for the "English(United States)" default setting, this would typically be: "mm/dd/yy hh:mm:ss {AM|PM}" |
DBTYPE_DBDATE | As specified by ISO: "yyyy-mm-dd" |
DBTYPE_FILETIME | "yyyyy-mm-dd hh:mm:ss.fff" where fff is from 0-999. Up to 3 digits may be used. The format is the same as SYSTEMTIME. Valid filetime value is 0x0000000000000000 - 0x7FFFFFFFFFFFFFFF, which is 01601-01-01 00:00:000 - 30828-09-14 02:24:05.477. |
DBTYPE_DBTIME | As specified by ISO: "hh:mm:ss" |
DBTYPE_ DBTIMESTAMP |
As specified by ISO: "yyyy-mm-dd hh:mm:ss.f..." where "f..." is fractions of a second (up to nine digits may be used). |
DBTYPE_GUID | As represented in the registry: "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" where x is a hexadecimal digit. |
DBTYPE_STR DBTYPE_WSTR DBTYPE_BSTR |
Conversion between strings of different locale IDs (LCIDs) is not supported. Conversion between ANSI and Unicode strings of the same LCID are required. In converting a Unicode string to ANSI, information may be lost because the Unicode range is greater. Lost characters are represented in the ANSI string by a special character and the conversion is considered to be a truncation. When mixing character sets, conversion to Unicode is the preferred solution. If conversion to ANSI is needed to use ANSI strings with the user interface, and the LCID of the user interface is different from the LCID of some columns, then the consumer is responsible for the conversion. The LCID of a column is returned in the DBCOLUMN_COLLATING_SEQUENCE column returned by IColumnsRowset::GetColumnsRowset. |