title: ADO Recordset->EndOfFile giving me _com_error when Empty Recordset
body: <p>I'm using ADO, and getting a very weird com error.</p>
  
  <p>So I'm simply running a stored proc using ADO CommandPtr, and storing it in a Recordset.</p>
  
  <p>Here is what I'm doing:</p>
  
  <pre><code>_ConnectionPtr Connptr;
  //Instantiate ConnectionPtr...
  
  _CommapndPtr CommPtr;
  CommPtr.CreateInstance(__uuidof(Command));
  CommPtr-&gt;CommandType = adCmdText;
  CommPtr-&gt;ActiveConnection = ConnPtr;
  CommPtr-&gt;CommandText = "Execute MyDb..MyStoredProc";
  
  _RecordsetPtr RecPtr;
  RecPtr.CreateInstance(__uuidof(Recordset));
  RecPtr-&gt;CursorLocation = adUseClient;
  RecPtr-&gt;CacheSize = 150;
  
  RecPtr = CommPtr-&gt;Execute(NULL, NULL, adOptionUnspecified);   //RecPtr = Empty Recordset
  
  while (!RecPtr-&gt;EndOfFile) {       //ERROR HAPPENS HERE!!!
      //Do something
      RecPtr-&gt;MoveNext();
  }
  </code></pre>
  
  <p>So my stored procedure is supposed to returns an empty recordset (0 rows).</p>
  
  <p>But then , when I check if the recordset has reached the end (which should simply return true if it is empty). I get a com error.</p>
  
  <p>When I caught the com error and printed it out, I got this.</p>
  
  <pre><code>Code = -2147217849
  Meaning = IDispatch error #3153
  Source = NULL
  </code></pre>
  
  <p>Which doesn't tell me much.</p>
  
  <p>I don't understand why <code>RecPtr-&gt;EndofFile</code> is throwing a com error, since it should simply return true/false.</p>
  
  <p>I highly doubt that the error is caused because I'm doing something wrong when initializing Connection and Command objects. (If so, then I would have gotten the error when Executing the command.)</p>
  
  <p>Any ideas on what might be causing this exception?</p>