473,322 Members | 1,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

CoInitialize error when using adodbapi


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
1 2710
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I...
10
by: Achim Domma | last post by:
Hi, I read a webpage via urllib2. The result of the 'read' call is of type 'str'. This string can be written to disc via file('out.html','w').write(html). Then I write the string into a...
0
by: Raaijmakers, Vincent \(GE Infrastructure\) | last post by:
Hopefully posted on the correct newsgroup. The adodbapi group seems so quit.... I want to distinguish between 1) an error in the sql statement to create a table, and 2) when the sql is...
4
by: nightmarch | last post by:
I want use crsr.nextset() , But I got errors like following: >>> connStr = "Provider=MSDAORA.1;Password=jmpower;User ID=jmpower;Data Source=jmgis_agps3;Persist Security Info=True" >>> import...
0
by: Gijs Korremans | last post by:
Hi, I'm extending a Python application that uses several com objects and threads. The origional programmer set the main thread to multithreaded by doing this: * sys.coinit_flags = 0 * import...
4
by: Michael Kennedy [UB] | last post by:
Hi, I'm working on a project which makes use of COM in unmanaged C++. That unmanaged C++ is then wrapped in a managed C++ class. Finally, this managed C++ class is then consumed in a C#...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
0
by: Ken Varn | last post by:
I have a thread that was running queries on a database using ADO.NET. The process owning the thread was exhibiting a memory leak on each call to run a query with SqlCommand::ExecuteReader() or...
1
by: Urs Wigger | last post by:
Hi, I wanted to instantiate a STA COM component twice, once in the main thread and once in a secondary thread. All worked fine for the main thread, but for the secondary thread, I got 'Query...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.