[Zope-DB] ZSQL Method dictionaries() failing - Please help!

jwsacksteder@ramprecision.com jwsacksteder@ramprecision.com
Tue, 20 May 2003 11:27:59 -0400


> I connecting to a MS SQL Server using ODBC on Win2000. 

A-ha.

> On the other hand, to get the contents of the table 'holidays', when I
> execute context.getHolidays().dictoinaries(), I get -
> Error Type: AttributeError
> Error Value: DatabaseResults instance has no attribute 'dictionaries'

ZODBCDA does not support dictionaries.
See the following posts.

http://mail.zope.org/pipermail/zope-db/2002-September/000889.html

and more irritatingly...

http://mail.python.org/pipermail/zope-collector-monitor/2002-August/000894.h
tml

You can still access your results ordinally by position- 

dataset=misc_sql()
for row in dataset:
   print row[0]

will print the 1st column of each row by position, not name. It works, but
you must be careful to preserve the order of your result columns. Two other
ways to get data from ms-sql are mxODBC(commercial) or the remote ODBC DA
included in Zdataquerykit.