FAQ
Problem:

Works fine when running python test.py but fails when executing
test.exe.


test.py:

conn = win32com.client.gencache.EnsureDispatch('ADODB.Connection')
conn.Open("Provider='SQLOLEDB';Data Source='.';Initial
Catalog='mydatabase';User ID='user';Password='pwd';")
.
.
.

setup.py:(same KeyError)

from distutils.core import setup
import py2exe

setup(console=['test.pyw'],
options = { "py2exe": { "typelibs":
[('{00000550-0000-0010-8000-00AA006D2EA4}', 0, 2, 8)]
}
}
)

(Doesn't work since its not registered or need to get the

setup.py: (same KeyError)

from distutils.core import setup
import py2exe

setup(console=['test.pyw'])


Generated error when running test.exe:

Traceback (most recent call last):
File "test.py", line 66, in ?
File "test.py", line 57, in main
File "test.py", line 16, in test_status
File "win32com\client\gencache.pyc", line 540, in EnsureDispatch
File "win32com\client\CLSIDToClass.pyc", line 50, in GetClass
KeyError: '{00000550-0000-0010-8000-00AA006D2EA4}'


Solution:

Use a registered typelib that has ADODB.Connection functionality :)



Any suggestions...

Search Discussions

  • Mudcat at May 26, 2005 at 8:08 pm
    I'm not positive about this, but when using com you need to force it
    into the compile. In my applications where I use Excel I use this line:

    python setup.py py2exe --progid "Excel.Application"

    You may need to do something similar for the db application.
  • Mudcat at Jun 3, 2005 at 1:00 am
    Ok apparently that's not the fix. I just tried that with Python 2.4 and
    the newest version of py2exe and win32all, and I can not get it to
    work.

    Can someone explain how to freeze Excel with the new version of py2exe?
    The old way isn't working anymore. I used one of the templates
    provided, but I kept getting CLSID errors, even when I provide the
    typelib in the options menu in setup.

    So "--progid" was removed, what replaced it?

    Thanks

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedMay 25, '05 at 9:21p
activeJun 3, '05 at 1:00a
posts3
users2
websitepython.org

2 users in discussion

Mudcat: 2 posts List Repository: 1 post

People

Translate

site design / logo © 2022 Grokbase