CoInitialize Error on Database Connection
Posted: Tue 12 Sep 2017 07:53
Hi,
I have been trying to integrate DevArt dbExpress component (trial version) in my Delphi 2009 application. When I do so in a separate thread it gives me the following error:
So, it started working. Previously I was using dbExpress version 10 that comes with Delphi (which uses OLE DB driver for SQL Server). It did not gave me this error. But when I have tried to use DevArt component (which uses SQL Server Native Client 11), the error appeared. My question is that why do I need to call CoInitialize in devArt when I do not need this in the dbExpress component.
Regards,
Adeel.
I have been trying to integrate DevArt dbExpress component (trial version) in my Delphi 2009 application. When I do so in a separate thread it gives me the following error:
So, I added the following code in the Execute method of the thread:OLE DB error occurred. Code 800401F0h.
CoInitialize has not been called.
Code: Select all
CoInitializeEx(nil, COINIT_APARTMENTTHREADED);
Regards,
Adeel.