Thread View: borland.public.cppbuilder.database.ado
3 messages
3 total messages
Started by Ozan Kilicoglu
Thu, 01 Mar 2001 20:06
creating TADOstoredProc inside thread context
Author: Ozan Kilicoglu
Date: Thu, 01 Mar 2001 20:06
Date: Thu, 01 Mar 2001 20:06
15 lines
1395 bytes
1395 bytes
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
Re: creating TADOstoredProc inside thread context
Author: Alexei Karas
Date: Fri, 02 Mar 2001 09:14
Date: Fri, 02 Mar 2001 09:14
32 lines
1817 bytes
1817 bytes
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
>
>
Re: creating TADOstoredProc inside thread context
Author: 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 > > > > > >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads