The pyodb module doesn't implement this behavior.  You would have to create a dictionary of column positions and column names in advance.<br><br><div class="gmail_quote">On Sat, Jun 21, 2008 at 3:52 PM, Chris <<a href="mailto:cwitts@gmail.com">cwitts@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="Ih2E3d">On Jun 21, 3:58 pm, <a href="mailto:dana...@yahoo.com">dana...@yahoo.com</a> wrote:<br>
> Is there any way to retrieve column names from a cursor using the ODBC<br>
> module? Or must I, in advance, create a dictionary of column position<br>
> and column names for a particular table before I can access column<br>
> values by column names? I'd prefer sticking with the ODBC module for<br>
> now because it comes standard in Python.<br>
><br>
> I'm using Python 2.4 at the moment.<br>
><br>
> Thanks.<br>
<br>
</div>You should be able to do<br>
<br>
column_names = [d[0] for d in cursor.description]<br>
<div><div></div><div class="Wj3C7c">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>| _ | * | _ |<br>| _ | _ | * |<br>| * | * | * |