Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I found the exact problem as well. Apparently this is common with the free ODBC drivers. This has been my morning headache from trying to migrate a project from MySQL to ODBC SQL Server. I finally found what got rid of this for me.</p> <p>This error shows up because an active cursor still exists from the previous result set. I was able to get rid of this error without using the disconnect/reconnect method by ensuring I read through the entire first record set (even if only using a partial piece of it) before issuing a new one. Note: I'm using PHP.</p> <p><strong>Gives me an error:</strong></p> <p>$sql="SELECT COUNT(whatever) as whatever FROM whatever";<br /> $countResult = odbc_exec($db, $sql);<br /> $countMenuHeader = odbc_fetch_array($countResult);<br /> extract ($countMenuHeader);<br /> $countRecords = $NumMenuHeader;<br /></p> <p>$sql="SELECT whatever as whatever FROM whatever";<br /> $result = odbc_exec($db, $sql);<br /> $MenuHeader = odbc_fetch_array($result);<br /></p> <p><strong>Cleared the error:</strong></p> <p>$sql="SELECT COUNT(whatever) as whatever FROM whatever";<br /> $countResult = odbc_exec($db, $sql);<br /></p> <p>while($countMenuHeader = odbc_fetch_array($countResult))<br /> {<br />&nbsp;&nbsp; extract ($countMenuHeader);<br />&nbsp;&nbsp; $countRecords = $NumMenuHeader;<br />}</p> <p>$sql="SELECT whatever as whatever FROM whatever";<br /> $result = odbc_exec($db, $sql);<br /> $MenuHeader = odbc_fetch_array($result);<br /></p> <p><strong>In short, make sure you completely read or fetch the data set before moving to the next statement.</strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload