By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,002 Members | 1,020 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,002 IT Pros & Developers. It's quick & easy.

CoInitialize error when using adodbapi

P: n/a

Hi,

I'm using adodbapi wrapper arount OLEDB driver and I got this error when
calling adodbapi.connect():
(-2147221008, 'CoInitialize has not been called.', None, None)

The weird part is that it occurs only when running under WebKit, my
standalone test programs run just fine.

I'm using py2.3 with win32all build 163, if that matters.

Any ideas?

tia.
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Basically, adodbapi uses COM, and COM and threads require a bit of care,
apparently. Your webkit thing may be using a thread to handle stuff.

import pythoncom
pythoncom.CoInitialize()
.... code ...
pythoncom.CoUnitialize()

You need to call pythoncom.CoInitialize() once for each thread... theres
something about sys.coinit_flags = 0 (or 1) that may be nessecary but I
don't know what they mean precisely :)

--Stephen
"Max Ischenko" <ma*@ucmg.com.ua.remove.it> wrote in message
news:c0**********@hyppo.gu.net...

Hi,

I'm using adodbapi wrapper arount OLEDB driver and I got this error when
calling adodbapi.connect():
(-2147221008, 'CoInitialize has not been called.', None, None)

The weird part is that it occurs only when running under WebKit, my
standalone test programs run just fine.

I'm using py2.3 with win32all build 163, if that matters.

Any ideas?

tia.

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.