How do I get column names from a string returned from an adodbapi query?
Suppose I am querying the database like this:
import adodbapi
conn = adodbapi.connect(connStr)
tablename = "[salesLT].[Customer]"
cur = conn.cursor()
sql = "select * from %s" % tablename
cur.execute(sql)
result = cur.fetchall()
The result is, I think, a sequence of SQLrow objects.
How can I get a list or sequence of column names returned by a query?
I think it is something like this:
row = result[0]
for k in row.keys():
print(k)
... but is .keys()
n't it.
and .columnNames()
+3
source to share