title: OleDbException: Data type mismatch in criteria expression
body: <p>I read data from MS Access using C#. But get the OleDbException trying to execute such query:</p>
  
  <pre><code>SELECT * FROM Flats 
  WHERE Flats.VersionStamp &lt;= [theDate] AND Flats.Flat=[theFlat]
  </code></pre>
  
  <p>OleDbException:</p>
  
  <pre><code>Data type mismatch in criteria expression.
  </code></pre>
  
  <p>On the other side, any one of the following queries works fine:</p>
  
  <pre><code>SELECT * FROM Flats 
  WHERE Flats.VersionStamp &lt;= [theDate] AND Flats.Flat=1
  
  SELECT * FROM Flats 
  WHERE Flats.VersionStamp &lt;= #1/1/2009# AND Flats.Flat=[theFlat]
  </code></pre>
  
  <p>The C# code stays the same all the time:</p>
  
  <pre><code>DbParameter theFlat = new OleDbParameter("theFlat", 1);
  DbParameter theDate = new OleDbParameter("theDate", new DateTime(2009, 1, 1));
  
  using (DbDataReader reader = dbHelper.ExecuteReader(sqlText, theFlat, theDate))
  { }
  </code></pre>
  
  <p>Finally, the query can be successfully executed directly in the MS Access UI.</p>
  
  <p>What is wrong here?</p>