title: conversion of a varchar to a smalldatetime results in an out-of-range value
body: <p>The code:</p>
  
  <pre><code>strSql = "insert into table2 (transactiondate) values ('" &amp; transactiondate &amp; "')"
  </code></pre>
  
  <p>seems to be giving me the runtime error:</p>
  
  <pre><code>The conversion of a varchar data type to a smalldatetime data type resulted in an out-of-range value
  </code></pre>
  
  <p>In the code, strSql is a String object and transactiondate is a Date object.
  In the SQL database however, transactiondate is a smalldatetime object.</p>
  
  <p>I've tried changing the smalldatetime to a datetime (in the database) and I've tried transactiondate.toString() but with no success.</p>
  
  <p>How can this be fixed?</p>
  
  <p>Note: I know about the dangers of inline SQL. I am looking for a quick fix solution here and not a discussion about SQL injection.</p>