title: Error '80040e07' when trying to add a record in Access database
body: <p>I am getting error 80040e07 when trying to add a record in Access using classic ASP. The code was working perfectly yesterday.</p>
  <blockquote>
  <p>Microsoft JET Database Engine error '80040e07'</p>
  <p>Data type mismatch in criteria expression.</p>
  <p>/alumni/admin/addvalue.asp, line 3</p>
  </blockquote>
  <p>The fields <em>btitle</em>, <em>bname</em>, <em>baddress</em>, <em>bphone</em> and <em>bpincode</em> can be blank while others are mandatory.</p>
  <p>My code:</p>
  <pre class="lang-vbs prettyprint-override"><code>dim conn, rs, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, concat, sqlstr
  Set conn=Server.createObject(&quot;ADODB.Connection&quot;)
  Set rs=Server.createObject(&quot;ADODB.Recordset&quot;)
  conn.open=&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot;&amp;Server.MapPath(&quot;\alumni/alumni.mdb&quot;) &amp; &quot;&quot;
  t1=Request.form(&quot;txtfname&quot;)
  t2=Request.form(&quot;txtlname&quot;)
  t3=Request.form(&quot;txtprn&quot;)
  t4=Request.form(&quot;txtbdate&quot;)
  t5=Request.form(&quot;gender&quot;)
  t6=Request.form(&quot;txtmail&quot;)
  t7=Request.form(&quot;txtaddrs&quot;)
  t8=Request.form(&quot;txtcity&quot;)
  t9=Request.form(&quot;txtstate&quot;)
  t10=Request.form(&quot;txtpincode&quot;)
  t11=Request.form(&quot;txtpphone&quot;)
  t12=Request.form(&quot;txtsecphone&quot;)
  t13=Request.form(&quot;drpdegree&quot;)
  t14=Request.form(&quot;drppassyear&quot;)
  t15=Request.form(&quot;txtdesg&quot;)
  t16=Request.form(&quot;txtcname&quot;)
  t17=Request.form(&quot;txtcaddr&quot;)
  t18=Request.form(&quot;txtccity&quot;)
  t19=Request.form(&quot;txtcstate&quot;)
  t20=Request.form(&quot;txtcpincode&quot;)
  t21=Request.form(&quot;txtcphone&quot;)
  t22=Request.form(&quot;txtcmail&quot;)
  concat=t14&amp;t3
  if(t20=&quot;&quot;)then
      t20=0
  end if
  sqlstr=&quot;insert into users(userid,passwd,utype,ufname,ulname,uprnumber,ubdate,ugender,uemail,uaddress,ucity,ustate,upincode,upphone,usphone,udegree,upassyear,btitle,bname,baddress,bcity,bstate,bpincode,bphone,bemail)values('&quot;&amp;t6&amp;&quot;','&quot;&amp;concat&amp;&quot;','student','&quot;&amp;t1&amp;&quot;','&quot;&amp;t2&amp;&quot;','&quot;&amp;t3&amp;&quot;','&quot;&amp;t4&amp;&quot;','&quot;&amp;t5&amp;&quot;','&quot;&amp;t6&amp;&quot;','&quot;&amp;t7&amp;&quot;','&quot;&amp;t8&amp;&quot;','&quot;&amp;t9&amp;&quot;','&quot;&amp;t10&amp;&quot;','&quot;&amp;t11&amp;&quot;','&quot;&amp;t12&amp;&quot;','&quot;&amp;t13&amp;&quot;','&quot;&amp;t14&amp;&quot;','&quot;&amp;t15&amp;&quot;','&quot;&amp;t16&amp;&quot;','&quot;&amp;t17&amp;&quot;','&quot;&amp;t18&amp;&quot;','&quot;&amp;t19&amp;&quot;','&quot;&amp;t20&amp;&quot;','&quot;&amp;t21&amp;&quot;','&quot;&amp;t22&amp;&quot;')&quot;
  response.write(&quot;this is the string&quot;&amp;sqlstr)
  'response.write(&quot;THIS IS PASSWORD &quot;+concat)
  rs.open &quot;insert into users(userid,passwd,utype,ufname,ulname,uprnumber,ubdate,ugender,uemail,uaddress,ucity,ustate,upincode,upphone,usphone,udegree,upassyear,btitle,bname,baddress,bcity,bstate,bpincode,bphone,bemail)values('&quot;&amp;t6&amp;&quot;','&quot;&amp;concat&amp;&quot;','student','&quot;&amp;t1&amp;&quot;','&quot;&amp;t2&amp;&quot;','&quot;&amp;t3&amp;&quot;','&quot;&amp;t4&amp;&quot;','&quot;&amp;t5&amp;&quot;','&quot;&amp;t6&amp;&quot;','&quot;&amp;t7&amp;&quot;','&quot;&amp;t8&amp;&quot;','&quot;&amp;t9&amp;&quot;','&quot;&amp;t10&amp;&quot;','&quot;&amp;t11&amp;&quot;','&quot;&amp;t12&amp;&quot;','&quot;&amp;t13&amp;&quot;','&quot;&amp;t14&amp;&quot;','&quot;&amp;t15&amp;&quot;','&quot;&amp;t16&amp;&quot;','&quot;&amp;t17&amp;&quot;','&quot;&amp;t18&amp;&quot;','&quot;&amp;t19&amp;&quot;',&quot;&amp;t20&amp;&quot;,'&quot;&amp;t21&amp;&quot;','&quot;&amp;t22&amp;&quot;')&quot;,conn
  </code></pre>
  <p>JavaScript code:</p>
  <pre class="lang-js prettyprint-override"><code>var fname = '&lt;%=t1&amp;t2%&gt;';
  var email='&lt;%=t6%&gt;';
  var passwd='&lt;%=concat%&gt;';
  alert('hi,'+fname+'your regestration is successful.'+'\nyour Id='+email+'\nPassword='+passwd);
  window.location=&quot;http://localhost/alumni/default.asp&quot;;
  </code></pre>