Article View: borland.public.cppbuilder.database.ado
Article #5671Re: creating TADOstoredProc inside thread context
From: J. R. Antley
Date: Wed, 07 Mar 2001 04:02
Date: Wed, 07 Mar 2001 04:02
43 lines
2090 bytes
2090 bytes
Alexei is correct. You have to CoInitialize and CoUninitialize in every thread which uses COM. JR "Alexei Karas" <nospam_AlexKaras_thatsextraaswell@hotmail.com> wrote in message news:3a9f65aa_1@dnews... > Try to do exactly what it says;) > Execute in TThread->Execute() > > ::CoInitialize(); > TADOStoredProc *adoSP = new TADOStoredProc(NULL); > [your stuff goes here] > ::CoUninitialize(); > > HTH, > Alexei > > > "Ozan Kilicoglu" <ozan.kilicoglu@eee.deu.edu.tr> wrote in message > news:3a9ea96b_2@dnews... > > when I try to execute... > > > > TADOStoredProc *adoSP = new TADOStoredProc(NULL); > > > > this line of code from the thread's context ( in TThread->Execute() > > method ). > > its ended with an error message: > > EOleSysError... 'CoIn�tialize has not been called' > > > > Of course, it works when called from Thread's constructor ( which belongs > > to App. context.) However, I don't want to use this solution because I > want > > each thread to manage its own TADOStoredProc connection. How can I execute > > this line from within thread's context? if I can not, what should I do? > > > > thanks in advance > > > > > >
Technical Details
Message-ID:
<98484s$s8q6@bornews.inprise.com>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!newsfeed.direct.ca!look.ca!hub.org!hub.org!PeerFeed.KWeb.on.ca!bornews.borland.com!not-for-mailReferences:
<3a9ea96b_2@dnews> <3a9f65aa_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,7247137ae13bcf7b X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2001-03-06 19:02:07 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!newsfeed.direct.ca!look.ca!hub.org!hub.org!PeerFeed.KWeb.on.ca!bornews.borland.com!not-for-mail From: "J. R. Antley" <jantley@phoenixdsl.com> Newsgroups: borland.public.cppbuilder.database.ado Subject: Re: creating TADOstoredProc inside thread context Date: Tue, 6 Mar 2001 20:02:55 -0800 Organization: Another Netscape Collabra Server User Lines: 45 Message-ID: <98484s$s8q6@bornews.inprise.com> References: <3a9ea96b_2@dnews> <3a9f65aa_1@dnews> NNTP-Posting-Host: 64-6-178-230.den1.phoenixdsl.net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200