<font class="fixed_width" face="Courier, Monospaced">(Reposted to DB-SIG from clp)<br><br>This week, I used the adodbapi module against an SQL Server Express <br> database. I was surprised to get an exception, when I attempted to <br>
 submit a second query with my cursor object. The full session is <br> below. <br> </font><p><font class="fixed_width" face="Courier, Monospaced">With cx_Oracle I&#39;ve become used to reusing a cursor for subsequent <br>
 queries. The PEP doesn&#39;t specify either way, that I can see. Is this <br> behaviour left to the implementation, or should I be able to expect a <br> cursor is reusable? <br> </font></p><p><font class="fixed_width" face="Courier, Monospaced">With thanks, Alex <br>
 </font></p><p><font class="fixed_width" face="Courier, Monospaced">Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit <br> (Intel)] on win32 <br> Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information. <br>
 </font></p><div id="qhide_209932" style="display: block;" class="qt"><font class="fixed_width" face="Courier, Monospaced">&gt;&gt;&gt; import adodbapi <br>
&gt;&gt;&gt; conn = adodbapi.connect(&#39;Provider=SQLOLEDB.1;Data
Source=.\\SQLEXPRESS;Initial Catalog=MYDATABBASE;Integrated
Security=SSPI;User Instance=False;&#39;) <br> &gt;&gt;&gt; curs = conn.cursor() <br> &gt;&gt;&gt; curs.execute(&#39;select * from localview_roles&#39;) <br> &gt;&gt;&gt; curs.execute(&#39;select * from localview_roles&#39;) <br>
 <br></font></div><font class="fixed_width" face="Courier, Monospaced">Traceback (most recent call last): <br> &nbsp; File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt; <br> &nbsp; File &quot;C:\Python25\Lib\site-packages\adodbapi\adodbapi.py&quot;, line 713, <br>
 in execut <br> e <br> &nbsp; &nbsp; self._executeHelper(operation,False,parameters) <br> &nbsp; File &quot;C:\Python25\Lib\site-packages\adodbapi\adodbapi.py&quot;, line 664, <br> in _execu <br> teHelper <br> &nbsp; &nbsp; self._raiseCursorError(DatabaseError,tracebackhistory) <br>
 &nbsp; File &quot;C:\Python25\Lib\site-packages\adodbapi\adodbapi.py&quot;, line 474, <br> in _raise <br> CursorError <br> &nbsp; &nbsp; eh(self.conn,self,errorclass,errorvalue) <br> &nbsp; File &quot;C:\Python25\Lib\site-packages\adodbapi\adodbapi.py&quot;, line 60, <br>
 in standar <br> dErrorHandler <br> &nbsp; &nbsp; raise errorclass(errorvalue) <br> adodbapi.adodbapi.DatabaseError: <br> --ADODBAPI <br> Traceback (most recent call last): <br> &nbsp; &nbsp;File &quot;C:\Python25\Lib\site-packages\adodbapi\adodbapi.py&quot;, line <br>
 650, in _exec <br> uteHelper <br> &nbsp; &nbsp; adoRetVal=self.cmd.Execute() <br> &nbsp; &nbsp;File &quot;&lt;COMObject ADODB.Command&gt;&quot;, line 3, in Execute <br> &nbsp; &nbsp;File &quot;C:\Python25\lib\site-packages\win32com\client\dynamic.py&quot;, <br>
 line 258, in <br> &nbsp;_ApplyTypes_ <br> &nbsp; &nbsp; result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, <br> retType, argTypes <br> ) + args) <br> &nbsp;com_error: (-2147352567, &#39;Exception occurred.&#39;, (0, u&#39;Microsoft OLE <br>
 DB Provider <br> &nbsp;for SQL Server&#39;, u&#39;Cannot create new connection because in manual or <br> distribute <br> d transaction mode.&#39;, None, 0, -2147467259), None) <br> -- on command: &quot;select * from localview_roles&quot; <br>
 -- with parameters: None </font><font class="fixed_width" face="Courier, Monospaced"></font>