title: Invalid Cursor State When Running SQL Server SP
body: <p>I am trying to run a stored procedure and im getting the error below. I tried doing AutoCommit = True but still no luck.</p>
  <p>error:</p>
  <pre><code>pypyodbc.ProgrammingError: ('24000', '[24000] [Microsoft][ODBC SQL Server Driver]Invalid cursor state')
  </code></pre>
  <p>code</p>
  <pre><code> def sqlConnection():
  conn = pypyodbc.connect('Driver={SQL Server};''Server=test;''Database=test;'
                          'Trusted_Connection=yes;autocommit=True')
  
  cursor = conn.cursor()
  
  
  return conn, cursor
  
  def paymentsFPL(cursor, conn):
      cd = datetime.today()
      formatted_date = datetime.strftime(cd, &quot;%m/%d/%Y&quot;)
  
      jobkey = 1
      date = formatted_date
      sql = f&quot;exec pRptMonTrTypeSumm {jobkey}, '{date}'&quot;
  
      fpl_payments_results = cursor.execute(sql).fetchall()
  </code></pre>