Export to GitHub

pyodbc - issue #400

Python 3 and PyOdbc3.0.10 AttributeError when accessing row columns by column-name.


Posted on May 27, 2015 by Swift Bird

What steps will reproduce the problem? 1. select mycolumnname from mytable where myclause 2. iterate over Row data and try accessing via column name 3. using Python 3 and pyodbc3.0.10 on windows connecting to a MS SQL server using either standard "SQL Server" driver or "SQL Server Native Client 10" driver.

What is the expected output? What do you see instead? I should be able to access row column data by the column header names. using an example SQL statement of say "select adminuserid from adminuser;" records are returned but when iterating over row data, accessing theRow.adminuserid throws an error... >>>> "AttributeError: 'Row' object has no attribute 'adminuserid'" (NOTE: the data in each Row IS accessible via position syntax but not by name)

What version of the product are you using? On what operating system? Using pyodbc3.0.10 on Windows 7, via Python 3, connecting to MS SQL Server 2008 database.

Please provide any additional information below. This has worked for years using Python 2.7, but my new application is now in Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)]

Comment #1

Posted on Jun 15, 2015 by Swift Bird

Please ignore this issue, it was from another cause.

Status: New

Labels:
Type-Defect Priority-Medium