Native SQL Client and CoInitialize

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
TinTin
Posts: 46
Joined: Sat 30 May 2009 14:09

Native SQL Client and CoInitialize

Post by TinTin » Wed 30 Jun 2010 17:25

if i use mssql2008,unidac config "native sql client",running in multi thread,is it need to call "CoInitialize / CoUninitialize "? The OLE DB Provider must use "CoInitialize / CoUninitialize ".

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 01 Jul 2010 10:17

Yes, you should execute the CoInitialize function in a thread and for SQL Native Client as well.

TinTin
Posts: 46
Joined: Sat 30 May 2009 14:09

Post by TinTin » Thu 01 Jul 2010 17:29

I mean,if i dont use CoInitialize/CoUninitialize in Native client SQL,it can work as well? i think it is a native client, so it is different from OLEDB.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 02 Jul 2010 08:39

UniDAC works with Native Client via OLE interface, therefore you should use CoInitialize.

Post Reply