[Zope] ODBC DSN file

Thomas B. Passin tpassin@mitretek.org
Wed, 16 May 2001 15:45:04 -0400


[Tino Wildenhain]

>
> You know of a python toolkit to handle Excel data?
> I would like to hear from it :)
>
Not exactly, but there are two ways to go (at least).

1) Access the spreadsheet through an odbc driver, using one of the python
odbc database packages, like mxodbc.  Then you shouldn't have any trouble
with dynamically-generated connection strings.  mxodbc is easy to use.  If
you went this route, you'd probably want to return the data to Zope in the
form of lists or dictionaries, and do your display and styling using Zope.

2) Install the Windows COM extensions (I presume they will work with Zope,
although I don't positively know that).  Then you can use COM calls to talk
to Excel and get the data that way.  This assumes you are on a Windows
platform, of course.

You would access your python code through an external method with either
approach.  That method should do nothing more than pass some REQUEST form
data to your code and return the resuls to Zope, if at all possible.

Still, there must be a reasonable way to programatically change the DSN
string in a zsql method, even though I don't know how.  As I recall, that
was what your original question was about.  Then you wouldn't need all the
external python stuff (might end up being easier, though, depending on what
you want to do).

Cheers,

Tom P