[python-win32] Having ODBC and Excel problems with Python
2.3.4/PyWin 201.1 on Windows Xp
stan lysiak
stanlx at yahoo.com
Fri Jun 11 21:44:12 EDT 2004
Hi,
Until this week I have been using Python 2.3.3 and
win32all build 163 on a Windows XP machine to connect
to a Sybase server using Sybase 11 ODBC and process
and place the results into Excel 2002 worksheets. The
only problem I encountered was that Python longs
between 2**31 and 2**32 were interpreted as signed
integers when I placed them into Excel and displayed
as negative values. I just converted them to floats
and they displayed correctly.
I decided to upgrade to Python 2.3.4 and PyWin build
201.1. I've been having strange problems.
First excel. Using PyWin 201.1, if I write a second
range onto a worksheet, I get an access error and
Python abends with an uncaught exception. Moving back
to build 200 seems to fix this problem.
Then ODBC. In some python programs, if I use
parameterized selects in 201.1, the ODBC module
complains that there is a missing column in an insert.
If I perform the substitution before calling ODBC
with the cursor, it works fine. I tried using an
explicit tuple conversion instead of the , style, and
the calls worked as well. e.g. curs.execute (query,
tuple (subval))
instead of curs.execute (query, (subval,)) In other
programs the ODBC code that worked under 2.3.3 and
build 163 worked flawlessly in build 200 and 201.1.
Am I doing something wrong or are these known problems
under later builds of Python and Pywin? I'll probably
just go back to the earlier win32all build 163 if
these are known problems with no workarounds.
I looked at the ODBC.cpp module, and as near as I
could figure, everything looked OK. Is it possible
that these are problems with my Windows XP
configuration? I'm not very familiar with the Windows
programming API.
Thanks,
Stan
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/
More information about the Python-win32
mailing list