odbc and accessing database results by field

JZ jroznfgre at jngpugbjreQBGbet.cy
Tue Oct 28 10:26:26 EST 2003


import odbc
conn = odbc.odbc('mydsn')
c = conn.cursor()
c.execute('SELECT TOP 10 field1, field2 FROM TABLE')
rows = c.fetchall()
c.close()
conn.close()

I am using MSSQL2000. My problem is:
Instead of row[0], rows[1] 
I would like to use row['field1], row['field']
Is it possible for odbc module?
I cannot find any comprehensive documentation :(

--
JZ ICQ:6712522





More information about the Python-list mailing list