Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

DEMO - coinitialize

 Post Reply Post Reply
Jürgen Bucher View Drop Down
New Member
New Member

Joined: 29 Aug 2014
Posts: 23
Post Options Post Options   Quote Jürgen Bucher Quote  Post ReplyReply Direct Link To This Post Topic: DEMO - coinitialize
    Posted: 29 Aug 2014 at 7:48am

when i try to use your DEMO i always get an EOleSysError "CoInitialize has not been called"
What can i do?

Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support

Joined: 18 May 2010
Posts: 2898
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 29 Aug 2014 at 8:03am
Call CoInitialize in CreateADOConnection as well. This is an ADO limitation (not RemoteDB limitation) since CoInitialize must be called in every thread. We have fixed the demo here as well.

function TForm1.CreateADOConnection: TADOConnection;
  Conn: TADOConnection;
  ConnectionString: string;
  CoInitializeEx(nil, COINIT_MULTITHREADED); // Add this
  ConnectionString := edConnectionString.Text;
  Conn := TADOConnection.Create(nil);
  Conn.ConnectionString := ConnectionString;
  Conn.LoginPrompt := false;
  Result := Conn;

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down