title: MS Access: No value given for one or more required parameters
body: <p>I'm trying to run the following query to an MS Access database (from an .asp page) :</p>
  
  <pre><code>SELECT firstname, lastname, emp_id FROM employees ORDER BY firstname
  </code></pre>
  
  <p>However, I get an error saying </p>
  
  <pre>
  No value given for one or more required parameters.
  </pre>
  
  <p>Now, the query runs fine if I exclude the "emp_id" (primary key) field. I have made sure that the field exists and that there are no typos in the query.</p>
  
  <p>If I run the query through the MS Access GUI, there's a pop-up asking me to enter a "parameter value" for the emp_id field. Could this be why it won't work, and why does it happen?</p>
  
  <p>Getting the employees from the db:</p>
  
  <pre><code>Function GetEmployees()
  
      Dim employeesRS, sqlGetEmployees, employeesList, e
  
      Set employeesList = CreateObject("System.Collections.ArrayList")
  
      sqlGetEmployees = "SELECT firstname, lastname, emp_id FROM employees ORDER BY firstname"
  
      Set employeesRS = db.connTb.execute(sqlGetEmployees) 'Custom class to simplify db-querying
  
      While Not employeesRS.EOF
  
          Set e = new Employee
  
          e.Firstname = employeesRS("firstname")
          e.Lastname = employeesRS("lastname")
          e.Id = employeesRS("emp_id")
  
          employeesList.Add(e)
  
          employeesRS.MoveNext
      Wend
  
      employeesRS.Close
  
      Set GetEmployees = employeesList
  
  End Function
  </code></pre>
  
  <p>Screenshot of table structure: (As you probably noticed, I translated the table and code in my post, to make it more readable . The relationship between code/table fields is identical though. )</p>
  
  <p><img src="https://i.stack.imgur.com/S6XKT.png" alt="enter image description here"></p>