OLE DB Provider for SQLite databases
Based on SQLite v. 220.127.116.11
(SOURCE_ID 2014-04-03 16:53:12 a611fa96c4a848614efe899130359c9f6fb889c3).
Make options: SQLITE_ENABLE_COLUMN_METADATA and SQLITE_THREADSAFE=2.
Make options for the provider: VC++ 2010, static runtime, static ATL, Win32 and x64.ConnectionString: "Provider=SQLITEDB;Data Source=< name/path to the database file >"
Date/time is stored as FLOAT values, suitable for functions that use julianday(). The provider translates the FLOAT values to the classic DATE format for the consumer. So when the provider sends parameters of the DBTYPE_DATE type, it adds 2415018.5 to the value; and when the provider reads data from the database columns of the suitable type, it subtracts 2415018.5. Please keep this in mind when building database inquiries.
The provider uses the following technique to identify the column type when making database inquiries:1. The provider calls the function sqlite3_column_decltype for a column. If the type is a known one, it is analyzed as follows:
a. “BLOB” or “IMAGE” – The column type is (DBTYPE_BYTES | DBTYPE_BYREF), and ISequentialStream* is used.
b. “DATETIME” – The column type is DBTYPE_DATE. Supposedly, the database stores date/time as FLOAT values,
in the Julian Day format, so the provider subtracts (double) 2415018.5 to make the data suitable for the consumer.
c. “INTEGER” or “INT” – The column type is DBTYPE_I8.
d. “FLOAT” – The column type is DBTYPE_R8.
e. “TEXT” or “NVARCHAR” – The column type is (DBTYPE_WSTR | DBTYPE_BYREF). The maximum length,2. If the column type has not been identified yet, the provider calls the function sqlite3_column_type, and the column type is analyzed as follows:
if specified after the column type, will be used.
a. SQLITE_INTEGER – DBTYPE_I8.
b. SQLITE_FLOAT – If the column name contains the string “date” or “time”, the column type is DBTYPE_DATE;
otherwise the column type is DBTYPE_R8.
c. SQLITE_TEXT – (DBTYPE_WSTR | DBTYPE_BYREF). The maximum length is unknown.
d. SQLITE_BLOB – (DBTYPE_BYTES | DBTYPE_BYREF), and ISequentialStream* is used.
e. SQLITE_NULL – DBTYPE_VARIANT.