title: Why is $rs->RowCount not returning a value?
body: <p>I'm using a basic SQL query with ADO and PHP but the row count always returns -1.  What am I missing?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>include 'constants.php';
  
  // Create an instance of the  ADO connection object
  $conn = new COM ("ADODB.Connection")
      or die("Cannot start ADO");
  
  // Open the connection to the database
  $conn-&gt;open(DB_CONN_STR);
  
  $query = "select * from table_name";
  
  $rs = $conn-&gt;execute($query);
  
  if (!$rs) {
      return;
  }
  else {
      return $rs-&gt;RecordCount();
  }
  </code></pre>
  
  <p>I know this table has values...what am I missing?</p>