title: Microsoft JET Database Engine error '80040e10' No value given for one or more required parameters
body: <p>I am currently a student attempting to learn and understand ASP. I would like to apologize in advance for any obvious or silly mistakes that might be discovered. I have no knowledge or understanding of ASP. I will be grateful for any advice or solution provided.</p>
  
  <p>My assignment: To use access database (2003 version of access) to create a doctor's list, in order to search for the doctor by name and/or zip code. I have created the doctor's list "Contacts. mdb" in access (2003), the html page with the form to allow for the search based on name and/or zip code of the doctor and the ASP page in order to retrieve the results based on the search criteria. </p>
  
  <p>The error I receive: 
  SELECT * FROM contacts where lastname like '%%';
  Microsoft JET Database Engine error '80040e10'</p>
  
  <p>No value given for one or more required parameters.</p>
  
  <p>/HPA563/Spring2014/kpatha3/Dynamic/OBGYNASPcode.asp, line 21</p>
  
  <p>My html form code: </p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  
  &lt;form id="form1" name="form1" method="post" action="OBGYNASPcode.asp"&gt;
    &lt;label&gt;Doctor's last name:
    &lt;input type="text" name="searchTerm" /&gt;
    &lt;/label&gt;
    &lt;label&gt;ZIP code:
    &lt;input type="text" name="locationTerm" /&gt;
    &lt;/label&gt;
    &lt;p&gt;
      &lt;input type="submit" name="Submit" value="Submit" /&gt;
    &lt;/p&gt;
  &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>ASP Code: </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;OBGYN ASP Page&lt;/title&gt;
  &lt;/head&gt;
  &lt;body bgcolor="white" text="black"&gt;
  &lt;%
  Set adoCon = Server.CreateObject("ADODB.Connection")
  
  adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &amp; Server.MapPath("contacts.mdb")
  
  Set rsDoctors = Server.CreateObject("ADODB.Recordset")
  
  if (request.form("locationTerm")="") then
     strSQL = "SELECT * FROM contacts where lastname like '%" &amp; request.form("searchTerm") &amp; "%';"
  else
      strSQL = "SELECT * FROM contacts where lastname like '%" &amp; request.form("searchTerm") &amp; "%' and zipcode = " &amp; request.form("locationTerm") &amp;";"
  
  end if
  Response.Write strSQL
  
      rsDoctors.Open strSQL, adoCon   
  
  Response.Write ("&lt;table border='1' width='600'&gt;") 
  Response.Write ("&lt;tr&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Location&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;") 
  Do While not rsDoctors.EOF 
  
  Response.Write ("&lt;tr&gt;&lt;td&gt;")
      Response.Write (rsDoctors("firstName") &amp;"&amp;nbsp;"&amp; rsDoctors("lastName"))  
      Response.Write ("&lt;/td&gt;&lt;td&gt;") 
      Response.Write (rsDoctors("zipcode")) 
      Response.Write ("&lt;/td&gt;") 
  
      rsDoctors.MoveNext 
      Loop
  
      rsDoctors.Close
      Set rsDoctors = Nothing
      Set adoCon = Nothing
  
  %&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>If I am missing any information, please let me know.</p>
  
  <p>Thank you! </p>