[Tutor] trouble with odbc

Daniel Coughlin kauphlyn@speakeasy.org
Thu, 29 Mar 2001 09:36:16 -0800 (PST)


hello all,

is anyone familiar with the odbc module? i am using it with ms sql server.
all i am trying to do is return rows from a table:

>>> db = odbc.odbc('northwind/sa')
>>> cur = s.cursor()
>>> cur.execute('select * from Customers')
>>> print cur.description
>>>        while 1:
>>>                rec = cur.fetchall()
>>>                if not rec: break
>>>                print rec

this runs fine and gives me a definition of each of the columns in table
Customers and all the data.
however, when i run the same script, swapping Customers with the Employees
table, I get column definition and the following error:

[Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index in FETCH

The only thing that I have noticed is that the columns in the Customers
table are all strings types while the columns in Employees are more varied,
having such datatypes as number and date. is there any reason why this would
cause a failure?

any help at all would be appreciated.

~d

ps - did i mention this is the best list in the world?