Home > Blockchain >  SQLite 'long' integers are returned truncated/incorrect by SQL select query — how can the
SQLite 'long' integers are returned truncated/incorrect by SQL select query — how can the

Time:01-04

In Excel VBA with the enter image description here

CodePudding user response:

As commented, essentially the issue derives from how to include the BigInt parameter in connection string. While MSDN documentation appears to differ from implementation, key/value pairs should avoid whitespaces:

DRIVER=SQLite3 ODBC Driver;Database=" & strDBasePath & ";BigInt=true" 

Lessons learned in debugging special attributes to ODBC connection strings:

  • Avoid preceding and trailing whitespaces and use single quotes for special string attributes;
  • For boolean attributes, check for case sensitivity (true vs True), integer (0, 1) synonyms, string (yes/no) synonyms;
  • For ending attributes, check for punctuation such as ending semicolon;
  • Run vanilla versions of connections and recordsets using default params without special configurations such as for CursorLocation, CursorType, and LockType;
  • Debug in other languages (i.e., Python, PowerShell) that support ODBC as control check to isolate environment or interface issues;
  • Carefully read documentation of specific ODBC driver or library/module and API like ADO.
  •  Tags:  
  • Related