473,569 Members | 2,459 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CoInitialize error when using adodbapi


Hi,

I'm using adodbapi wrapper arount OLEDB driver and I got this error when
calling adodbapi.connec t():
(-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 2720
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.CoIni tialize()
.... code ...
pythoncom.CoUni tialize()

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

--Stephen
"Max Ischenko" <ma*@ucmg.com.u a.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.connec t():
(-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
5020
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 double-checked the path to my error log. It is in /var/www/logs/php_error_log Thanks. :) -Wayne Stevenson
10
4966
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 Memofield in an Access database, using adodbapi. If I read the text back I get a unicode string, which can not written to disc via file(...) due to encoding...
0
1137
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 correct but the table exists in the database (and thus the create sql failed.) Is there an error that I can catch and figure out which of the above 2...
4
3306
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 adodbapi >>> conn= adodbapi.connect( connStr ) >>> crsr = conn.cursor() >>> sql = "select * from wjtmp" >>> crsr.execute(sql)
0
1672
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 pythoncom This is nessacary because otherwise a com (MapObjects2 from ESRI) can't runin a thread, but now I need to use another com object, which is...
4
672
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# application. It looks like this: C# App | | (one-to-many relationship) |
6
4726
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 appreciated. Thanks in advance
0
1185
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 SqlCommand::ExecuteNonQuerry() call. After I basically eliminated all other code out of the thread, it finally came down to a CoInitialize() call. ...
1
19297
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 Interface failed' errors when trying to access COM methods. I once had the same problem in a C++ application. The solution there was to call...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8132
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7678
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5222
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.