Jump to content

CoInitialize has not been called with Unidac for SQL Server


indyrhett

Recommended Posts

Hi I'm trying to connect to a TUniConnection with a Devart component that connects use OLEDB to an SQL Server. I'm simply placing on a MainModule like the help specifies and on the MainModuleConnect I'm issuing:  UniConnection1.Connected := True;    Running this app throws a CoInitialize has not been called error.

 

If I add ActiveX to the uses and call instead:

 

Coinitialize(0);

UniConnection1.Connected := True;

 

Then everything works as expected - however I've read this isn't a great idea. Anyone have an idea what I might be doing wrong here?

 

Thanks,

 

Rhett Price

IndySoft

 

Link to comment
Share on other sites

  • 5 months later...
  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...