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
Author
Jürgen Bucher View Drop Down
New Member
New Member
Avatar

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
Hi,

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

Jürgen
Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2434
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;
var
  Conn: TADOConnection;
  ConnectionString: string;
begin
  CoInitializeEx(nil, COINIT_MULTITHREADED); // Add this
  ConnectionString := edConnectionString.Text;
  Conn := TADOConnection.Create(nil);
  Conn.ConnectionString := ConnectionString;
  Conn.LoginPrompt := false;
  Result := Conn;
end;


Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down