Re: ADO in a console? ADO in a service?

From: Philippe Auphelle (pauphelle_at_wanadoo.fr)
Date: 11/26/04


Date: Fri, 26 Nov 2004 14:29:11 +0100

Thanks, Brian.

>ADO uses COM. CoInitialize needs to be called in any thread you use ADO in and
>CoUninitialize should be called when you are finished.

That doesn't seem to be too hard :-)

Does CoInitialize need to be called before the ADO components are even
created (i.e. before I create the containing datamodule)? /Ph.

On Thu, 25 Nov 2004 20:40:57 -0600, Brian Bushay TeamB
<BBushay@Nmpls.com> wrote:

>
>>Is it possible to reliably run ADO operations from applications
>>running without a win message pump, such as
>>
>>- a console?
>>- a service?
>Yes you can use ADO in a service or console app
>
>>Are there limitations, pitfalls and/or funny behaviors to be aware of?
>ADO uses COM. CoInitialize needs to be called in any thread you use ADO in and
>CoUninitialize should be called when you are finished.



Relevant Pages

  • Re: ADO + CoInitialize in threads? Mystery...
    ... I myself do not use ADO in threads, but I can tell you following. ... Can't tell you why at once I had that error message with "coInitialize ... CoInitializebefore using the ADO components and CoUninitializeat ... "Kjell Rilbe" escribió en el mensaje ...
    (borland.public.delphi.database.ado)
  • Re: ADO in multithreaded: Application Verifier (with WinDbg) gives "Invalid Handle" at the end of my
    ... Invalid Handle doesn't appear at CoUninitialize() function on this ... CoInitializeEx isn't called on any other thread from this application. ... Sorry if this sounds like a stupid suggestion, but did you switch ADO to ... If the database you are connecting to has a driver that support connection ...
    (microsoft.public.data.ado)
  • Re: Calling Coinitialize
    ... > Delphi 5 C/S compiled programs and use ADO. ... > the dll's doesn't seem to help) and then it will immediately crash ... not calling coInitialize and coUninitialize at all. ...
    (borland.public.delphi.database.ado)
  • Re: ADO and multithreading
    ... >>I am also able to get access to the database using ADO and retreive data. ... > own adoconnector and query ... > As the ado components are ActiveX, you have to remember to initialise ...
    (comp.lang.pascal.delphi.misc)
  • Re: Ado inside dll ?
    ... so what does CoInitialize and CoUninitialize? ... CoInitialize initializes COM and Ado uses COM ... In an normal .exe applicaiton co-initialize is handled in the ...
    (borland.public.delphi.database.ado)