Problem with new versions of win32all
Mike Cannon
m_cannon at pacbell.net
Tue Oct 28 20:05:50 EST 2003
I'm having a problem with the newer version of win32all and Python
2.3 with code that works fine on Python-2.2 (details below). Both
machines are Windows XP.
The code that breaks is derived from the venerable jet2sql.py cookbook
example. I added a routine that uses the daoEngine collection
"TableDefs" and indexes it with a string (the table name). That works
on Py-2.2/win32all-148 but not with Py-2.3/win32all-159.
Any help ?
Thanks in advance,
Mike
PS: I patched around this problem and the whole application seems fine
in the new environment now. But I'd still like to know the root cause.
============================================================================
Code I added to jet2sql.py:
...
self.dtbs = daoEngine.OpenDatabase(infile)
...
...
252: def tableGetPrimaryKey (self, tblName):
253: tbl = self.dtbs.TableDefs [ tblName ] # <<<< This breaks.
254: return self.getPrimaryKey ( tbl )
...
============================================================================
Traceback:
...
File "r:\FSRV\PROJECTS\Mello-et-al\jet2sql.py", line 253, in tableGetPrimaryKey
tbl = self.dtbs.TableDefs [ tblName ]
File "C:\DOCUME~1\cannon\LOCALS~1\Temp\gen_py\2.3\00025E01-0000-0000-C000-000000000046x0x5x0.py", line 1633, in __getitem__
return self._enum_.__getitem__(index)
File "C:\Python23\lib\site-packages\win32com\client\util.py", line 37, in __getitem__
return self.__GetIndex(index)
File "C:\Python23\lib\site-packages\win32com\client\util.py", line 42, in __GetIndex
if type(index)!=type(0): raise TypeError, "Only integer indexes are supported for enumerators"
TypeError: Only integer indexes are supported for enumerators
============================================================================
Old environment (works)
- ACCESS 2000 / DAO 3.6
- Python 2.2 (ActiveState, from aspn.activestate.com April, '03)
- win32all-148
- makepy on DAO 3.6 Object Library
New Environment (breaks)
- ACCESS 2000 / DAO 3.6
- Python 2.3 -- http://www.python.org/2.3.2/ --> Python-2.3.2-1.exe
- win32all-159.exe -- http://starship.python.net/crew/mhammond/
- makepy on DAO 3.6 Object Library
More information about the Python-list
mailing list