title: Access pass-through query giving error
body: <p>I'm using the following code to run a passthrough query.  I'm trying to run the passthrough query, then check how many records are returned to figure out if it worked.  But I get an error saying </p>
  
  <blockquote>
    <p>"Invalid Operation"</p>
  </blockquote>
  
  <p>Why is it doing this and how can I correct?</p>
  
  <pre><code>  Dim Item As String
    Item = InputBox("Enter Item needing a surrogate UPC.", "Enter Item")
  
  
  Set db = CurrentDb
  
  Set qdf = db.QueryDefs("spAL_AssignSurrogateUPC")
  qdf.ReturnsRecords = True
  qdf.SQL = "spAL_AssignSurrogateUPC '" &amp; Item &amp; "'"
  With qdf.OpenRecordset(dbOpenSnapshot)       '&lt;--- Error triggered here.
      If qdf.RecordCount = 1 Then
          MsgBox "Surrogate UPC assigned."
      Else
          MsgBox "ERROR.  Could not assign surrogate UPC."
      End If
  End With
  </code></pre>