WanderInCode / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

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

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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)]

Original issue reported on code.google.com by loreproj...@gmail.com on 27 May 2015 at 11:50

GoogleCodeExporter commented 8 years ago
Please ignore this issue, it was from another cause.

Original comment by loreproj...@gmail.com on 15 Jun 2015 at 12:15