Unable to query SQL view
<p>I'm working on an old classic ASP site and have run into a problem. I can query database tables but not views.</p>

<p>This query on a table returns the correct number of rows:</p>

<pre><code>Set rs = Server.CreateObject("ADODB.Recordset")
sqlQuery = "SELECT * FROM tblContent;"
rs.Open sqlQuery, conn, 1, 2
response.write "q1 cnt = " &amp; rs.RecordCount
</code></pre>

<p>The same query on a view returns <code>-1</code>:</p>

<pre><code>Set rs = Server.CreateObject("ADODB.Recordset")
sqlQuery = "SELECT * FROM myView;"
rs.Open sqlQuery, conn, 1, 2
response.write "q2 cnt = " &amp; rs.RecordCount
</code></pre>

<p>Both queries return the correct number of rows if run from SQL Server Management Studio but only one works when called from a <code>.asp</code> web page. The same seems to apply for all tables and views in the DB (I've tested half a dozen of so of each).</p>

<p>Can anyone offer any clues as to what is going on here?</p>