title: ODBC call failed - Random date overflow errors after moving from 32-bit ODBC 5.1 to 64-bit 5.3
body: <p>Background:</p>
  
  <ul>
  <li>Legacy code running in MS Access 2003.</li>
  <li>Sqls run by CurrentDB in Access. </li>
  <li>Currently running on Windows 7 32-bit machine.</li>
  <li>Connecting to MySQL Server 5.5 through a ODBC 5.1 Driver.</li>
  </ul>
  
  <p>Problem:</p>
  
  <ul>
  <li>Trying to migrate to Windows server 2012 64 bit.</li>
  <li>ODBC 5.3 Unicode Driver (32 bit).</li>
  <li>Don't want to use time rewriting everything as there is a lot of code, and it will in a not to distant future be removed.</li>
  </ul>
  
  <p>Issue:</p>
  
  <ul>
  <li>Several sql statements fail when running on the new servers. Worked on old servers.</li>
  <li>All the failed sqls have now() in the statement.</li>
  <li>Error description says ODBC call failed. While the more detailed description says date overflow - "[MySQL][ODBC 5.3(w) Driver][mysqlid-5.5.28-log]Date overflow".</li>
  <li>Happens randomly, and when it happens and Access stops one can usually just choose continue and the sql will then work. It fails less than 1% of the times it runs (of thousands). </li>
  <li>The only dates in the sql are in the where clause: "and fieldA > now()", where fieldA is a datetime column. This is a get recordset sql. Another error during an insert is the same, but where an integer was subtracted from now() before compared to a datetime.</li>
  </ul>
  
  <p>I don't understand why it says date overflow when there doesn't seem to be a reason for the time of either datetime or "now" to be removed? And since the datetime field is already in the database and now() will get current date and time there shouldn't be any invalid dates?</p>
  
  <p>Any help in what the problem might be or how to debug/log anything that might help would be highly appreciated. </p>
  
  <p>Turning trace on in the ODBC driver is not an option because it happens so randomly, there is so much traffic therefore this would slow down everything such that nothing happens. </p>
  
  <p>Note that I also did encounter one sql where the date overflow error message was correct. It seems that prior to 5.3 when inserting a datetime into a date field it was automatically truncated, because a sql which had been successfull 3000 times started failing. Therefore this sql has been fixed by extracting the date from the field first. But the other errors must be something different.</p>