mxODBC question

Steve Holden sholden at
Mon Feb 12 07:45:07 EST 2001

"Scott Hathaway" <slhath at> wrote in message
news:nTDh6.66287$bb.1038987 at
> I am using mxODBC to access db's with no problem, but I have a question.
> I use a sql call as follows:
> select username from users;
> Then, I make a call as follows:
> data = c.fetchall()
> Then, to access the first value of the first (and only) field, I have to
> use:
> theValue = data[0][0]
> This is ugly.  Is there a way to do something like:
> theValue = data[0]['firstname']
> Or anything more easy to discern for code readability?
> Thanks,
> Scott
The best tool I've come across for this is at

It has worked in a number of such contexts for me, allowing access by
attribute name or index, with a well-thought-out set of methods..


More information about the Python-list mailing list